From acccff9860b271d55c55dc87486f7c20b9896e6c Mon Sep 17 00:00:00 2001
From: puzhibing <393733352@qq.com>
Date: 星期一, 13 一月 2025 16:19:54 +0800
Subject: [PATCH] 修改bug

---
 ruoyi-service/ruoyi-account/src/main/java/com/ruoyi/account/controller/AgentApplicationController.java |   19 +++++++++++++------
 1 files changed, 13 insertions(+), 6 deletions(-)

diff --git a/ruoyi-service/ruoyi-account/src/main/java/com/ruoyi/account/controller/AgentApplicationController.java b/ruoyi-service/ruoyi-account/src/main/java/com/ruoyi/account/controller/AgentApplicationController.java
index fb2524d..8958c81 100644
--- a/ruoyi-service/ruoyi-account/src/main/java/com/ruoyi/account/controller/AgentApplicationController.java
+++ b/ruoyi-service/ruoyi-account/src/main/java/com/ruoyi/account/controller/AgentApplicationController.java
@@ -48,20 +48,26 @@
     @PostMapping("/page")
     @ApiOperation(value = "会员申请列表", tags = {"后台"})
     public R<IPage<AgentApplication>> page(@RequestBody AgentQuery agentQuery) {
-
-        return R.ok(agentApplicationService.pageList(agentQuery));
+        IPage<AgentApplication> agentApplicationIPage = agentApplicationService.pageList(agentQuery);
+        for (AgentApplication record : agentApplicationIPage.getRecords()) {
+            AppUser byId = appUserService.getById(record.getAppUserId());
+            if (byId!=null){
+                record.setVipId(byId.getVipId());
+            }
+        }
+        return R.ok(agentApplicationIPage);
     }
     @Resource
     private VipSettingClient vipSettingClient;
     @GetMapping("/detail")
     @ApiOperation(value = "会员申请详情", tags = {"会员中心-小程序"})
     public R<AgentApplication> detail(@RequestParam Long id) {
-        R<VipSetting> vipSetting = vipSettingClient.getVipSetting(id.intValue());
+        AgentApplication agentApplication = agentApplicationService.getById(id);
+        R<VipSetting> vipSetting = vipSettingClient.getVipSetting(agentApplication.getApplicationVipId());
         VipSettingDto vipSettingDto = new VipSettingDto();
         BeanUtils.copyProperties(vipSetting.getData(),vipSettingDto);
-        AgentApplication byId = agentApplicationService.getById(id);
-        byId.setVipSettingDto(vipSettingDto);
-        return R.ok(byId);
+        agentApplication.setVipSettingDto(vipSettingDto);
+        return R.ok(agentApplication);
     }
     @Resource
     private UserChangeLogService userChangeLogService;
@@ -88,6 +94,7 @@
         userChangeLogService.save(userChangeLog);
         //变更会员等级
         byId1.setVipId(byId.getApplicationVipId());
+        appUserService.updateById(byId1);
         return R.ok(byId);
     }
 

--
Gitblit v1.7.1