From 792cbb986fb8c32f6bbc1638c4ae264372e7a28f Mon Sep 17 00:00:00 2001
From: Pu Zhibing <393733352@qq.com>
Date: 星期四, 23 一月 2025 19:31:36 +0800
Subject: [PATCH] 新增引流接口及业务逻辑
---
ruoyi-service/ruoyi-account/src/main/java/com/ruoyi/account/controller/TAppUserVipDetailController.java | 57 +++++++++++++++++++++++++++++++++++++++++++++++++++++----
1 files changed, 53 insertions(+), 4 deletions(-)
diff --git a/ruoyi-service/ruoyi-account/src/main/java/com/ruoyi/account/controller/TAppUserVipDetailController.java b/ruoyi-service/ruoyi-account/src/main/java/com/ruoyi/account/controller/TAppUserVipDetailController.java
index 898a5eb..27c8667 100644
--- a/ruoyi-service/ruoyi-account/src/main/java/com/ruoyi/account/controller/TAppUserVipDetailController.java
+++ b/ruoyi-service/ruoyi-account/src/main/java/com/ruoyi/account/controller/TAppUserVipDetailController.java
@@ -1,16 +1,27 @@
package com.ruoyi.account.controller;
+import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
+import com.ruoyi.account.api.dto.SendCouponDto;
import com.ruoyi.account.api.model.TAppUserVipDetail;
+import com.ruoyi.account.api.model.TVip;
import com.ruoyi.account.api.vo.GetAppUserVipDetail;
import com.ruoyi.account.service.TAppUserVipDetailService;
+import com.ruoyi.account.util.VipInfoDto;
import com.ruoyi.common.core.domain.R;
-import org.springframework.web.bind.annotation.PostMapping;
-import org.springframework.web.bind.annotation.RequestBody;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RestController;
+import com.ruoyi.common.security.service.TokenService;
+import com.ruoyi.other.api.domain.TCoupon;
+import com.ruoyi.other.api.dto.VipCouponDto;
+import com.ruoyi.other.api.feignClient.OtherClient;
+import com.ruoyi.other.api.feignClient.VipClient;
+import io.swagger.annotations.ApiOperation;
+import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
+import java.math.BigDecimal;
+import java.time.LocalDateTime;
+import java.util.ArrayList;
+import java.util.List;
/**
* @author zhibing.pu
@@ -22,6 +33,8 @@
@Resource
private TAppUserVipDetailService appUserVipDetailService;
+ @Resource
+ private TokenService tokenService;
/**
* 获取用户当前有效的vip明细
@@ -36,6 +49,42 @@
.last(" and now() between start_time and end_time"));
return R.ok(one);
}
+
+ @Resource
+ private VipClient vipClient;
+ @Resource
+ private OtherClient otherClient;
+
+ @GetMapping("/getVipUseDetail")
+ @ApiOperation(value = "生效会员列表", tags = {"小程序-个人中心"})
+ public R<List<TAppUserVipDetail>> getVipUseDetail(){
+ Long userId = tokenService.getLoginUserApplet().getUserId();
+ List<TAppUserVipDetail> list = appUserVipDetailService.lambdaQuery().eq(TAppUserVipDetail::getAppUserId, userId).last(" and now() <= end_time order by start_time asc").list();
+
+ for (TAppUserVipDetail tAppUserVipDetail : list) {
+ if(null != tAppUserVipDetail.getVipId()){
+ TVip tVip = JSONObject.parseObject(tAppUserVipDetail.getVipJson(), TVip.class);
+// TVip data = vipClient.getInfo1(tAppUserVipDetail.getVipId()).getData();
+ tAppUserVipDetail.setVipName(tVip.getName());
+ tAppUserVipDetail.setType(tVip.getType());
+ tAppUserVipDetail.setVip(tVip);
+ }
+ }
+
+
+
+
+ return R.ok(list);
+ }
+ /**
+ * 修改会员明细
+ * @param appUserVipDetail
+ */
+ @PostMapping("/updateAppUserVipDetail")
+ public void updateAppUserVipDetail(@RequestBody TAppUserVipDetail appUserVipDetail){
+ appUserVipDetailService.updateById(appUserVipDetail);
+ }
+
}
--
Gitblit v1.7.1