Pu Zhibing
2025-01-16 a23f0ba99b7e3c1ad270dd5a263a6b48b4b8fb6f
ruoyi-service/ruoyi-account/src/main/java/com/ruoyi/account/controller/AgentApplicationController.java
@@ -1,5 +1,6 @@
package com.ruoyi.account.controller;
import java.time.LocalDateTime;
import java.util.ArrayList;
import java.util.List;
import java.util.stream.Collectors;
@@ -24,6 +25,7 @@
import com.ruoyi.other.api.feignClient.VipSettingClient;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.springframework.util.CollectionUtils;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
@@ -47,6 +49,10 @@
    private BaseSettingClient baseSettingClient;
    @Resource
    private VipCenterService vipCenterService;
    @Resource
    private VipSettingClient vipSettingClient;
    @Resource
    private UserChangeLogService userChangeLogService;
    @PostMapping("/apply")
    @ApiOperation(value = "会员申请", tags = {"会员中心-小程序"})
@@ -59,28 +65,25 @@
    @ApiOperation(value = "会员申请列表", tags = {"后台"})
    public R<IPage<AgentApplication>> page(@RequestBody AgentQuery 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) {
        AgentApplication agentApplication = agentApplicationService.getById(id);
        AppUser appUser = appUserService.getById(agentApplication.getAppUserId());
        agentApplication.setShopPoint(appUser.getShopPoint());
        agentApplication.setSharePoint(appUser.getSharePoint());
        R<VipSetting> vipSetting = vipSettingClient.getVipSetting(agentApplication.getApplicationVipId());
        VipSettingDto vipSettingDto = new VipSettingDto();
        BeanUtils.copyProperties(vipSetting.getData(),vipSettingDto);
        agentApplication.setVipSettingDto(vipSettingDto);
        agentApplication.setVipId(agentApplication.getApplicationVipId());
        return R.ok(agentApplication);
    }
    @Resource
    private UserChangeLogService userChangeLogService;
    @GetMapping("/auth")
    @ApiOperation(value = "会员申请审核", tags = {"会员中心-小程序"})