充值代理页面数据调整
This commit is contained in:
parent
0a3e88dc08
commit
ef0633c035
@ -11,8 +11,9 @@ import com.red.circle.order.inner.model.dto.MonthlyRechargeSummaryVO;
|
||||
import com.red.circle.order.inner.model.dto.UserMonthlyRechargeDTO;
|
||||
import com.red.circle.other.app.dto.h5.RechargePageVO;
|
||||
import com.red.circle.other.app.service.recharge.RechargeUserService;
|
||||
import com.red.circle.other.infra.database.rds.dao.team.BusinessDevelopmentTeamDAO;
|
||||
import com.red.circle.other.infra.database.rds.entity.team.AdminRechargeAgentRelation;
|
||||
import com.red.circle.other.infra.database.rds.service.sys.AdministratorService;
|
||||
import com.red.circle.other.infra.database.rds.service.team.AdminRechargeAgentRelationService;
|
||||
import com.red.circle.other.inner.endpoint.user.user.UserProfileClient;
|
||||
import com.red.circle.other.inner.model.dto.user.UserProfileDTO;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
@ -32,7 +33,7 @@ public class RechargeUserServiceImpl implements RechargeUserService {
|
||||
private final UserMonthlyRechargeClient userMonthlyRechargeClient;
|
||||
private final UserProfileClient userProfileClient;
|
||||
private final AdministratorService administratorService;
|
||||
private final BusinessDevelopmentTeamDAO businessDevelopmentTeamDAO;
|
||||
private final AdminRechargeAgentRelationService adminRechargeAgentRelationService;
|
||||
|
||||
@Override
|
||||
public PageResult<RechargePageVO> getRechargePage(PageUserIdCmd page, AppExtCommand cmd) {
|
||||
@ -41,10 +42,10 @@ public class RechargeUserServiceImpl implements RechargeUserService {
|
||||
ResponseAssert.failure(CommonErrorCode.OPERATING_FAILURE);
|
||||
}
|
||||
|
||||
Page<Object> objectPage = new Page<>();
|
||||
Page<AdminRechargeAgentRelation> objectPage = new Page<>();
|
||||
objectPage.setCurrent(page.getPageQuery().getCursor());
|
||||
objectPage.setSize(page.getPageQuery().getLimit());
|
||||
Page<Long> pagedRechargeAgency = businessDevelopmentTeamDAO.pageRechargeAgency(cmd.getReqUserId(), objectPage);
|
||||
Page<Long> pagedRechargeAgency = adminRechargeAgentRelationService.pageRechargeAgentByAdmin(cmd.getReqUserId(), objectPage);
|
||||
if (pagedRechargeAgency == null || pagedRechargeAgency.getRecords().isEmpty()) {
|
||||
return null;
|
||||
}
|
||||
@ -75,10 +76,10 @@ public class RechargeUserServiceImpl implements RechargeUserService {
|
||||
@Override
|
||||
public List<MonthlyRechargeSummaryVO> getRechargeSummary(AppExtCommand cmd) {
|
||||
|
||||
Page<Object> objectPage = new Page<>();
|
||||
Page<AdminRechargeAgentRelation> objectPage = new Page<>();
|
||||
objectPage.setCurrent(1L);
|
||||
objectPage.setSize(3000L);
|
||||
Page<Long> pagedRechargeAgency = businessDevelopmentTeamDAO.pageRechargeAgency(cmd.getReqUserId(), objectPage);
|
||||
Page<Long> pagedRechargeAgency = adminRechargeAgentRelationService.pageRechargeAgentByAdmin(cmd.getReqUserId(), objectPage);
|
||||
if (pagedRechargeAgency == null || pagedRechargeAgency.getRecords().isEmpty()) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@ -45,13 +45,13 @@ public class AdminRechargeAgentRelation {
|
||||
/**
|
||||
* 创建时间.
|
||||
*/
|
||||
@TableField(value = "create_time", fill = FieldFill.INSERT)
|
||||
@TableField(value = "create_time")
|
||||
private LocalDateTime createTime;
|
||||
|
||||
/**
|
||||
* 修改时间.
|
||||
*/
|
||||
@TableField(value = "update_time", fill = FieldFill.INSERT_UPDATE)
|
||||
@TableField(value = "update_time")
|
||||
private LocalDateTime updateTime;
|
||||
|
||||
}
|
||||
|
||||
@ -1,5 +1,6 @@
|
||||
package com.red.circle.other.infra.database.rds.service.team;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.red.circle.framework.mybatis.service.BaseService;
|
||||
import com.red.circle.other.infra.database.rds.entity.team.AdminRechargeAgentRelation;
|
||||
|
||||
@ -33,4 +34,13 @@ public interface AdminRechargeAgentRelationService extends BaseService<AdminRech
|
||||
*/
|
||||
void add(AdminRechargeAgentRelation relation);
|
||||
|
||||
/**
|
||||
* 分页查询管理员下的充值代理.
|
||||
*
|
||||
* @param adminUserId 管理员用户ID
|
||||
* @param page 分页对象
|
||||
* @return 分页结果
|
||||
*/
|
||||
Page<Long> pageRechargeAgentByAdmin(Long adminUserId, Page<AdminRechargeAgentRelation> page);
|
||||
|
||||
}
|
||||
|
||||
@ -1,6 +1,8 @@
|
||||
package com.red.circle.other.infra.database.rds.service.team.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.red.circle.framework.mybatis.service.impl.BaseServiceImpl;
|
||||
import com.red.circle.other.infra.database.rds.dao.team.AdminRechargeAgentRelationDAO;
|
||||
import com.red.circle.other.infra.database.rds.entity.team.AdminRechargeAgentRelation;
|
||||
@ -35,4 +37,20 @@ public class AdminRechargeAgentRelationServiceImpl extends
|
||||
save(relation);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Page<Long> pageRechargeAgentByAdmin(Long adminUserId, Page<AdminRechargeAgentRelation> page) {
|
||||
IPage<AdminRechargeAgentRelation> relationPage = page(page, new LambdaQueryWrapper<AdminRechargeAgentRelation>()
|
||||
.eq(AdminRechargeAgentRelation::getAdminUserId, adminUserId)
|
||||
.orderByDesc(AdminRechargeAgentRelation::getCreateTime));
|
||||
|
||||
Page<Long> result = new Page<>();
|
||||
result.setCurrent(relationPage.getCurrent());
|
||||
result.setSize(relationPage.getSize());
|
||||
result.setTotal(relationPage.getTotal());
|
||||
result.setRecords(relationPage.getRecords().stream()
|
||||
.map(AdminRechargeAgentRelation::getUserId)
|
||||
.toList());
|
||||
return result;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user