修改配送方式问题

main
13233904609 1 month ago
parent feae7cdd95
commit 6a1c6bedc8

@ -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.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.dto.MemberUserRespDTO;
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.validation.Valid;
import java.util.List;
import java.util.Map;
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.util.collection.CollectionUtils.convertMap;
@ -47,6 +51,9 @@ public class BrokerageUserController {
@Resource
private MemberUserApi memberUserApi;
@Resource
private MemberLevelApi memberLevelApi;
@PutMapping("/update-bind-user")
@Operation(summary = "修改推广员")
@PreAuthorize("@ss.hasPermission('trade:brokerage-user:update-bind-user')")
@ -92,6 +99,9 @@ public class BrokerageUserController {
// 查询用户信息
Set<Long> userIds = convertSet(pageResult.getList(), BrokerageUserDO::getId);
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(
userIds, BrokerageRecordBizTypeEnum.ORDER.getType(), BrokerageRecordStatusEnum.SETTLEMENT.getStatus());
@ -106,7 +116,7 @@ public class BrokerageUserController {
userIds, BrokerageWithdrawStatusEnum.AUDIT_SUCCESS);
// 拼接返回
return success(BrokerageUserConvert.INSTANCE.convertPage(pageResult, userMap, brokerageUserCountMap,
brokerageOrderSummaryMap, withdrawMap));
brokerageOrderSummaryMap, withdrawMap,LevelMap));
}
}

@ -41,5 +41,9 @@ public class BrokerageUserRespVO extends BrokerageUserBaseVO {
private Integer withdrawPrice;
@Schema(description = "已提现次数", requiredMode = Schema.RequiredMode.REQUIRED, example = "20019")
private Integer withdrawCount;
@Schema(description = "会员等级", requiredMode = Schema.RequiredMode.REQUIRED, example = "李四")
private String levelName;
@Schema(description = "会员等级Id", requiredMode = Schema.RequiredMode.REQUIRED, example = "李四")
private Long levelId;
}

@ -39,11 +39,13 @@ public interface BrokerageUserConvert {
Map<Long, MemberUserRespDTO> userMap,
Map<Long, Long> brokerageUserCountMap,
Map<Long, UserBrokerageSummaryRespBO> userOrderSummaryMap,
Map<Long, BrokerageWithdrawSummaryRespBO> withdrawMap) {
Map<Long, BrokerageWithdrawSummaryRespBO> withdrawMap,
Map<Long, String> LevelMap) {
PageResult<BrokerageUserRespVO> result = convertPage(pageResult, userMap, brokerageUserCountMap, userOrderSummaryMap);
for (BrokerageUserRespVO userVO : result.getList()) {
// 用户信息
copyTo(userMap.get(userVO.getId()), userVO);
userVO.setLevelName(LevelMap.get(userVO.getLevelId()));
// 推广用户数量
userVO.setBrokerageUserCount(MapUtil.getInt(brokerageUserCountMap, userVO.getId(), 0));
// 推广订单数量、推广订单金额
@ -60,7 +62,7 @@ public interface BrokerageUserConvert {
default BrokerageUserRespVO copyTo(MemberUserRespDTO source, BrokerageUserRespVO target) {
Optional.ofNullable(source).ifPresent(
user -> target.setNickname(user.getNickname()).setAvatar(user.getAvatar()));
user -> {target.setNickname(user.getNickname()).setAvatar(user.getAvatar()).setLevelId(user.getLevelId());});
return target;
}

@ -1,5 +1,6 @@
package cn.iocoder.yudao.module.member.api.level;
import cn.iocoder.yudao.framework.common.enums.CommonStatusEnum;
import cn.iocoder.yudao.module.member.api.level.dto.MemberLevelRespDTO;
import cn.iocoder.yudao.module.member.enums.MemberExperienceBizTypeEnum;
@ -48,4 +49,11 @@ public interface MemberLevelApi {
* @return
*/
List<MemberLevelRespDTO> getLevelList(Collection<Long> ids);
/**
*
*
* @return
*/
List<MemberLevelRespDTO> getEnableLevelList();
}

@ -52,4 +52,9 @@ public class MemberLevelApiImpl implements MemberLevelApi {
return BeanUtils.toBean(memberLevelService.getLevelList(ids),MemberLevelRespDTO.class);
}
@Override
public List<MemberLevelRespDTO> getEnableLevelList() {
return BeanUtils.toBean(memberLevelService.getEnableLevelList(),MemberLevelRespDTO.class);
}
}

@ -585,8 +585,14 @@ public class MemberUserServiceImpl implements MemberUserService {
.ge(BrokerageUserDO::getLevel, memberLevelDO.getLevel())
.eq(BrokerageUserDO::getDeleted, 0)
);
//查询会员邀请记录下级会员
List<BrokerageUserDO> brokerageUserDOS1 = brokerageUserMapper.selectList(new LambdaQueryWrapperX<BrokerageUserDO>()
.eq(BrokerageUserDO::getBindUserId, userId)
.ge(BrokerageUserDO::getLevel, 2)
.eq(BrokerageUserDO::getDeleted, 0)
);
if(ObjectUtil.isNotEmpty(brokerageUserDOS)){
if(brokerageUserDOS.size()>=3){
if(brokerageUserDOS.size()>=5 && brokerageUserDOS1.size()>=30){
//升级会员
memberUserMapper.updateById(new MemberUserDO()
.setId(userId)

@ -3,8 +3,8 @@ spring:
name: yudao-server
profiles:
active: dev
# active: local
# active: dev
active: local
main:
allow-circular-references: true # 允许循环依赖,因为项目是三层架构,无法避免这个情况。

@ -197,8 +197,8 @@ const loginData = reactive({
tenantEnable: import.meta.env.VITE_APP_TENANT_ENABLE !== 'false',
loginForm: {
tenantName: '郑大钒水',
username: 'zdfs',
password: '123456',
username: '',
password: '',
captchaVerification: '',
rememberMe: false
}

@ -22,6 +22,7 @@
:placeholder="t('login.tenantNamePlaceholder')"
:prefix-icon="iconHouse"
link
disabled
type="primary"
/>
</el-form-item>

@ -44,6 +44,7 @@
</template>
</el-table-column>
<el-table-column label="昵称" align="center" prop="nickname" min-width="80px" />
<el-table-column label="分销等级" align="center" prop="levelName" min-width="80px" />
<el-table-column
label="推广人数"
align="center"

@ -43,6 +43,7 @@
</template>
</el-table-column>
<el-table-column label="昵称" align="center" prop="nickname" min-width="80px" />
<el-table-column label="分销等级" align="center" prop="levelName" min-width="80px" />
<el-table-column label="等级" align="center" prop="level" min-width="80px">
<template #default="scope">
<el-tag v-if="scope.row.bindUserId === bindUserId"></el-tag>

Loading…
Cancel
Save