From 3d6c34f45d76b78151d6586f93acca2943698b08 Mon Sep 17 00:00:00 2001
From: phpcjl <phpcjl@gmail.com>
Date: 星期一, 09 十二月 2024 10:56:42 +0800
Subject: [PATCH] 1.
---
ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/controller/VipSettingController.java | 124 +++++++++++++++++-----------------------
1 files changed, 53 insertions(+), 71 deletions(-)
diff --git a/ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/controller/VipSettingController.java b/ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/controller/VipSettingController.java
index 51d6b2f..4af566f 100644
--- a/ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/controller/VipSettingController.java
+++ b/ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/controller/VipSettingController.java
@@ -2,29 +2,18 @@
import com.ruoyi.account.api.feignClient.AppUserClient;
-import com.ruoyi.account.api.model.AppUser;
import com.ruoyi.common.core.domain.R;
import com.ruoyi.common.security.service.TokenService;
-import com.ruoyi.other.api.domain.VipGood;
import com.ruoyi.other.api.domain.VipSetting;
import com.ruoyi.other.service.VipGoodService;
import com.ruoyi.other.service.VipSettingService;
import io.swagger.annotations.ApiOperation;
-import org.springframework.web.bind.annotation.PostMapping;
-import com.ruoyi.common.core.domain.R;
-import com.ruoyi.other.api.domain.VipSetting;
-import com.ruoyi.other.service.VipSettingService;
+import org.springframework.web.bind.annotation.*;
import io.swagger.annotations.Api;
-import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
-import org.springframework.web.bind.annotation.GetMapping;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RestController;
import javax.annotation.Resource;
import java.util.List;
-
-import javax.annotation.Resource;
/**
* <p>
@@ -47,74 +36,67 @@
@Resource
private VipGoodService vipGoodService;
- @PostMapping("/info")
- @ApiOperation(value = "获取各级会员信息", tags = {"小程序-个人中心首页","小程序-会员中心"})
- public R<List<VipSetting>> info(){
+ @GetMapping("/info")
+ @ApiOperation(value = "获取各级会员信息", tags = {"小程序-个人中心首页", "小程序-会员中心"})
+ public R<List<VipSetting>> info() {
List<VipSetting> list = vipSettingService.list();
return R.ok(list);
}
- @PostMapping("/button/agent/check")
- @ApiOperation(value = "准代理,代理按钮是否展示", tags = {"小程序-个人中心首页","小程序-会员中心"})
- public R<Boolean> buttoncheck(@ApiParam("4准代理,5代理")Integer id){
- Long userid = tokenService.getLoginUserApplet().getUserid();
- AppUser appUserById = appUserClient.getAppUserById(userid);
- Boolean back = true;
- VipSetting byId = vipSettingService.getById(id);
- //第一种判断
- if (byId == null) {
- back = false;
- }else {
- if (byId.getVipAgentLevelUpRole() == null || byId.getVipAgentLevelUpRole() == 0) {
- back = false;
- }
- if (byId.getVipLevelUpShop() == null || byId.getVipLevelUpShare() == null) {
- back = false;
- } else {
- if (back && appUserById.getShopPoint().compareTo(byId.getVipLevelUpShop()) > 0 && appUserById.getSharePoint().compareTo(byId.getVipLevelUpShare()) > 0) {
- back = true;
- }
- }
- if (back) {
- return R.ok(true);
- }
- //第二种判断
- if (byId.getVipDirectVipRole()== null || byId.getVipDirectVipRole() == 0||byId.getVipDirectVipNum() == null) {
- back = false;
- }else {
- //拿到当前用户直推钻石会员人数
- Long data = appUserClient.getVipCount(userid, 3).getData();
- if (data>=byId.getVipDirectVipNum()){
- return R.ok(true);
- }
- }
- //第三种判断
- List<VipGood> list = vipGoodService.lambdaQuery().eq(VipGood::getVipId, id).list();
- for (VipGood vipGood : list) {
- //挨个判断是否购买商品
-
-
- }
-
-
- }
-
-
-
-
-
- return R.ok(list);
- }
-
+// @PostMapping("/button/agent/check")
+// @ApiOperation(value = "准代理,代理按钮是否展示", tags = {"小程序-个人中心首页","小程序-会员中心"})
+// public R<Boolean> buttoncheck(@ApiParam("4准代理,5代理")Integer id) {
+// Long userid = tokenService.getLoginUserApplet().getUserid();
+// AppUser appUserById = appUserClient.getAppUserById(userid);
+// Boolean back = true;
+// VipSetting byId = vipSettingService.getById(id);
+// //第一种判断
+// if (byId == null) {
+// back = false;
+// } else {
+// if (byId.getVipAgentLevelUpRole() == null || byId.getVipAgentLevelUpRole() == 0) {
+// back = false;
+// }
+// if (byId.getVipLevelUpShop() == null || byId.getVipLevelUpShare() == null) {
+// back = false;
+// } else {
+// if (back && appUserById.getShopPoint().compareTo(byId.getVipLevelUpShop()) > 0 && appUserById.getSharePoint().compareTo(byId.getVipLevelUpShare()) > 0) {
+// back = true;
+// }
+// }
+// if (back) {
+// return R.ok(true);
+// }
+// //第二种判断
+// if (byId.getVipDirectVipRole() == null || byId.getVipDirectVipRole() == 0 || byId.getVipDirectVipNum() == null) {
+// back = false;
+// } else {
+// //拿到当前用户直推钻石会员人数
+// Long data = appUserClient.getVipCount(userid, 3).getData();
+// if (data >= byId.getVipDirectVipNum()) {
+// return R.ok(true);
+// }
+// }
+// //第三种判断
+// List<VipGood> list = vipGoodService.lambdaQuery().eq(VipGood::getVipId, id).list();
+// for (VipGood vipGood : list) {
+// //挨个判断是否购买商品
+//
+//
+// }
+// }
+//
+// return R.ok();
+// }
@GetMapping("getVipSettingById")
@ApiOperation(value = "获取会员设置")
- public R<VipSetting> getVipSettingById(@ApiParam(value = "会员id") Integer id){
+ public R<VipSetting> getVipSettingById(@ApiParam(value = "会员id") @RequestParam Integer id) {
return R.ok(vipSettingService.getById(id));
}
-
-
-
}
+
+
+
--
Gitblit v1.7.1