|
|
@ -2,6 +2,8 @@ package cn.iocoder.yudao.module.trade.controller.admin.brokerage;
|
|
|
|
|
|
|
|
|
|
|
|
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
|
|
|
|
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
|
|
|
|
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
|
|
|
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
|
|
|
|
|
|
|
import cn.iocoder.yudao.module.member.api.level.MemberLevelApi;
|
|
|
|
|
|
|
|
import cn.iocoder.yudao.module.member.api.level.dto.MemberLevelRespDTO;
|
|
|
|
import cn.iocoder.yudao.module.member.api.user.MemberUserApi;
|
|
|
|
import cn.iocoder.yudao.module.member.api.user.MemberUserApi;
|
|
|
|
import cn.iocoder.yudao.module.member.api.user.dto.MemberUserRespDTO;
|
|
|
|
import cn.iocoder.yudao.module.member.api.user.dto.MemberUserRespDTO;
|
|
|
|
import cn.iocoder.yudao.module.trade.controller.admin.brokerage.vo.user.*;
|
|
|
|
import cn.iocoder.yudao.module.trade.controller.admin.brokerage.vo.user.*;
|
|
|
@ -24,8 +26,10 @@ import org.springframework.web.bind.annotation.*;
|
|
|
|
|
|
|
|
|
|
|
|
import javax.annotation.Resource;
|
|
|
|
import javax.annotation.Resource;
|
|
|
|
import javax.validation.Valid;
|
|
|
|
import javax.validation.Valid;
|
|
|
|
|
|
|
|
import java.util.List;
|
|
|
|
import java.util.Map;
|
|
|
|
import java.util.Map;
|
|
|
|
import java.util.Set;
|
|
|
|
import java.util.Set;
|
|
|
|
|
|
|
|
import java.util.stream.Collectors;
|
|
|
|
|
|
|
|
|
|
|
|
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
|
|
|
|
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
|
|
|
|
import static cn.iocoder.yudao.framework.common.util.collection.CollectionUtils.convertMap;
|
|
|
|
import static cn.iocoder.yudao.framework.common.util.collection.CollectionUtils.convertMap;
|
|
|
@ -47,6 +51,9 @@ public class BrokerageUserController {
|
|
|
|
@Resource
|
|
|
|
@Resource
|
|
|
|
private MemberUserApi memberUserApi;
|
|
|
|
private MemberUserApi memberUserApi;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Resource
|
|
|
|
|
|
|
|
private MemberLevelApi memberLevelApi;
|
|
|
|
|
|
|
|
|
|
|
|
@PutMapping("/update-bind-user")
|
|
|
|
@PutMapping("/update-bind-user")
|
|
|
|
@Operation(summary = "修改推广员")
|
|
|
|
@Operation(summary = "修改推广员")
|
|
|
|
@PreAuthorize("@ss.hasPermission('trade:brokerage-user:update-bind-user')")
|
|
|
|
@PreAuthorize("@ss.hasPermission('trade:brokerage-user:update-bind-user')")
|
|
|
@ -92,6 +99,9 @@ public class BrokerageUserController {
|
|
|
|
// 查询用户信息
|
|
|
|
// 查询用户信息
|
|
|
|
Set<Long> userIds = convertSet(pageResult.getList(), BrokerageUserDO::getId);
|
|
|
|
Set<Long> userIds = convertSet(pageResult.getList(), BrokerageUserDO::getId);
|
|
|
|
Map<Long, MemberUserRespDTO> userMap = memberUserApi.getUserMap(userIds);
|
|
|
|
Map<Long, MemberUserRespDTO> userMap = memberUserApi.getUserMap(userIds);
|
|
|
|
|
|
|
|
//查询会员等级信息
|
|
|
|
|
|
|
|
List<MemberLevelRespDTO> LevelList = memberLevelApi.getEnableLevelList();
|
|
|
|
|
|
|
|
Map<Long, String> LevelMap = LevelList.stream().collect(Collectors.toMap(MemberLevelRespDTO::getId, MemberLevelRespDTO::getName));
|
|
|
|
// 合计分佣的推广订单
|
|
|
|
// 合计分佣的推广订单
|
|
|
|
Map<Long, UserBrokerageSummaryRespBO> brokerageOrderSummaryMap = brokerageRecordService.getUserBrokerageSummaryMapByUserId(
|
|
|
|
Map<Long, UserBrokerageSummaryRespBO> brokerageOrderSummaryMap = brokerageRecordService.getUserBrokerageSummaryMapByUserId(
|
|
|
|
userIds, BrokerageRecordBizTypeEnum.ORDER.getType(), BrokerageRecordStatusEnum.SETTLEMENT.getStatus());
|
|
|
|
userIds, BrokerageRecordBizTypeEnum.ORDER.getType(), BrokerageRecordStatusEnum.SETTLEMENT.getStatus());
|
|
|
@ -106,7 +116,7 @@ public class BrokerageUserController {
|
|
|
|
userIds, BrokerageWithdrawStatusEnum.AUDIT_SUCCESS);
|
|
|
|
userIds, BrokerageWithdrawStatusEnum.AUDIT_SUCCESS);
|
|
|
|
// 拼接返回
|
|
|
|
// 拼接返回
|
|
|
|
return success(BrokerageUserConvert.INSTANCE.convertPage(pageResult, userMap, brokerageUserCountMap,
|
|
|
|
return success(BrokerageUserConvert.INSTANCE.convertPage(pageResult, userMap, brokerageUserCountMap,
|
|
|
|
brokerageOrderSummaryMap, withdrawMap));
|
|
|
|
brokerageOrderSummaryMap, withdrawMap,LevelMap));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|