From 7c74ee47c3f1ec69b9494d363621f43ad8b9c640 Mon Sep 17 00:00:00 2001 From: yujian <yujian@163.com> Date: 星期日, 26 四月 2020 12:14:59 +0800 Subject: [PATCH] 后台调整 --- fanli/src/main/java/com/yeshi/fanli/controller/wxmp/v1/UserAccountController.java | 81 ++++------------------------------------ 1 files changed, 8 insertions(+), 73 deletions(-) diff --git a/fanli/src/main/java/com/yeshi/fanli/controller/wxmp/v1/UserAccountController.java b/fanli/src/main/java/com/yeshi/fanli/controller/wxmp/v1/UserAccountController.java index 98da7e0..b2b3112 100644 --- a/fanli/src/main/java/com/yeshi/fanli/controller/wxmp/v1/UserAccountController.java +++ b/fanli/src/main/java/com/yeshi/fanli/controller/wxmp/v1/UserAccountController.java @@ -13,6 +13,7 @@ import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpSession; +import org.springframework.context.annotation.Lazy; import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.RequestMapping; import org.yeshi.utils.IPUtil; @@ -48,6 +49,7 @@ import com.yeshi.fanli.service.inter.config.ConfigService; import com.yeshi.fanli.service.inter.count.HongBaoV2CountService; import com.yeshi.fanli.service.inter.money.UserMoneyDetailService; +import com.yeshi.fanli.service.inter.order.CommonOrderService; import com.yeshi.fanli.service.inter.shop.BanLiShopOrderService; import com.yeshi.fanli.service.inter.user.ForbiddenUserIdentifyCodeService; import com.yeshi.fanli.service.inter.user.UserAccountService; @@ -113,6 +115,9 @@ @Resource private ThreeSaleSerivce threeSaleSerivce; + @Resource + private CommonOrderService commonOrderService; + /** @@ -565,7 +570,7 @@ continue; } // 1銆侀個璇峰叧绯绘垚鍔熷悗锛�2銆佸崟锛堝垎浜� + 鑷喘锛夊疄浠樻澶т簬1鍏� - long countValid = hongBaoV2CountService.countValidOrderByUidAndTime(worker.getId(), three.getSucceedTime(), payMoney); + long countValid = commonOrderService.countOrderByUidAndSettled(worker.getId(), payMoney); if (countValid > 0) { finishTeam ++; } @@ -634,77 +639,7 @@ JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult(1, "鐢ㄦ埛鏈櫥褰�")); return; } - - UserInfo userInfo = userInfoService.selectByPKey(uid); - if (userInfo == null) { - JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult(1, "璇ョ敤鎴蜂笉瀛樺湪")); - return; - } - - // 鐪侀挶 -鑷喘浜х敓杩斿埄 - - List<Integer> list = new ArrayList<Integer>(); - list.add(BanLiShopOrder.STATE_SUCCESS); - BigDecimal payMoney = new BigDecimal(userVipConfigService.getValueByKey("require_order_pay")); - -// long finishTeam = hongBaoV2CountService.countValidOrderTeamUserByUid(uid, -// TimeUtil.convertDateToTemp(Constant.VIP_ONLINE_TIME), payMoney); - long finishTeam = 0L; - 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) { - UserInfo worker = three.getWorker(); - if (worker == null || worker.getId() == null) { - continue; - } - // 1銆侀個璇峰叧绯绘垚鍔熷悗锛�2銆佸崟锛堝垎浜� + 鑷喘锛夊疄浠樻澶т簬1鍏� - long countValid = hongBaoV2CountService.countValidOrderByUidAndTime(worker.getId(), three.getSucceedTime(), payMoney); - if (countValid > 0) { - finishTeam ++; - } - } - } - - - - long finishHongBao = banLiShopOrderService.countByUidAndState(uid, list); - BigDecimal finishMoney = hongBaoV2CountService.getRewardMoneyBySelf(uid); - - long limitTeam = 0; - - // 鍖哄垎鑰佺敤鎴峰拰鏂扮敤鎴� - String limtDate = userVipConfigService.getValueByKey("vip_execute_time"); - Date executeDate = null; - try { - SimpleDateFormat format = new SimpleDateFormat("yyyy-mm-dd"); - executeDate = format.parse(limtDate); - } catch (ParseException e) { - e.printStackTrace(); - } - - UserInfoExtra extra = userInfoExtraService.getUserInfoExtra(uid); - if (extra != null - && (extra.getFirstLoginTime() == null || extra.getFirstLoginTime().getTime() < executeDate.getTime())) { - limitTeam = (Long.parseLong(userVipConfigService.getValueByKey("require_invite_num_old_user"))); - } else { - limitTeam = (Long.parseLong(userVipConfigService.getValueByKey("require_invite_num_new_user"))); - } - long limitHongBao = (Long.parseLong(userVipConfigService.getValueByKey("require_shop_buy"))); - BigDecimal limitMoney = (new BigDecimal(userVipConfigService.getValueByKey("require_fan_money"))); - - if (finishTeam >= limitTeam && finishHongBao >= limitHongBao && finishMoney.compareTo(limitMoney) >= 0) { - // 鏉′欢绗﹀悎 - } else { - if (!StringUtil.isNullOrEmpty(callback)) { - out.print(JsonUtil.loadJSONP(callback, JsonUtil.loadFalseResult("鏈揪鍒板紑閫氭潯浠�"))); - } else { - out.print(JsonUtil.loadFalseResult("鏈揪鍒板紑閫氭潯浠�")); - } - return; - } - // 寮�閫� try { userVIPInfoService.applyVIP(uid); } catch (UserVIPInfoException e) { @@ -717,9 +652,9 @@ } if (!StringUtil.isNullOrEmpty(callback)) { - out.print(JsonUtil.loadJSONP(callback, JsonUtil.loadTrueResult("宸茬敵璇�"))); + out.print(JsonUtil.loadJSONP(callback, JsonUtil.loadTrueResult("鐢宠鎴愬姛锛屾鍦ㄥ彈鐞嗕腑"))); } else { - out.print(JsonUtil.loadTrueResult("宸茬敵璇�")); + out.print(JsonUtil.loadTrueResult("鐢宠鎴愬姛锛屾鍦ㄥ彈鐞嗕腑")); } } -- Gitblit v1.8.0