diff --git a/ruoyi-vue-pro-master/yudao-module-mall/yudao-module-trade-biz/src/main/java/cn/iocoder/yudao/module/trade/controller/admin/brokerage/BrokerageUserController.java b/ruoyi-vue-pro-master/yudao-module-mall/yudao-module-trade-biz/src/main/java/cn/iocoder/yudao/module/trade/controller/admin/brokerage/BrokerageUserController.java index 622ff87..071917e 100644 --- a/ruoyi-vue-pro-master/yudao-module-mall/yudao-module-trade-biz/src/main/java/cn/iocoder/yudao/module/trade/controller/admin/brokerage/BrokerageUserController.java +++ b/ruoyi-vue-pro-master/yudao-module-mall/yudao-module-trade-biz/src/main/java/cn/iocoder/yudao/module/trade/controller/admin/brokerage/BrokerageUserController.java @@ -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 userIds = convertSet(pageResult.getList(), BrokerageUserDO::getId); Map userMap = memberUserApi.getUserMap(userIds); + //查询会员等级信息 + List LevelList = memberLevelApi.getEnableLevelList(); + Map LevelMap = LevelList.stream().collect(Collectors.toMap(MemberLevelRespDTO::getId, MemberLevelRespDTO::getName)); // 合计分佣的推广订单 Map 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)); } } diff --git a/ruoyi-vue-pro-master/yudao-module-mall/yudao-module-trade-biz/src/main/java/cn/iocoder/yudao/module/trade/controller/admin/brokerage/vo/user/BrokerageUserRespVO.java b/ruoyi-vue-pro-master/yudao-module-mall/yudao-module-trade-biz/src/main/java/cn/iocoder/yudao/module/trade/controller/admin/brokerage/vo/user/BrokerageUserRespVO.java index 3f5fe25..43fef07 100644 --- a/ruoyi-vue-pro-master/yudao-module-mall/yudao-module-trade-biz/src/main/java/cn/iocoder/yudao/module/trade/controller/admin/brokerage/vo/user/BrokerageUserRespVO.java +++ b/ruoyi-vue-pro-master/yudao-module-mall/yudao-module-trade-biz/src/main/java/cn/iocoder/yudao/module/trade/controller/admin/brokerage/vo/user/BrokerageUserRespVO.java @@ -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; } diff --git a/ruoyi-vue-pro-master/yudao-module-mall/yudao-module-trade-biz/src/main/java/cn/iocoder/yudao/module/trade/convert/brokerage/BrokerageUserConvert.java b/ruoyi-vue-pro-master/yudao-module-mall/yudao-module-trade-biz/src/main/java/cn/iocoder/yudao/module/trade/convert/brokerage/BrokerageUserConvert.java index aa4ba34..7038a8c 100644 --- a/ruoyi-vue-pro-master/yudao-module-mall/yudao-module-trade-biz/src/main/java/cn/iocoder/yudao/module/trade/convert/brokerage/BrokerageUserConvert.java +++ b/ruoyi-vue-pro-master/yudao-module-mall/yudao-module-trade-biz/src/main/java/cn/iocoder/yudao/module/trade/convert/brokerage/BrokerageUserConvert.java @@ -39,11 +39,13 @@ public interface BrokerageUserConvert { Map userMap, Map brokerageUserCountMap, Map userOrderSummaryMap, - Map withdrawMap) { + Map withdrawMap, + Map LevelMap) { PageResult 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; } diff --git a/ruoyi-vue-pro-master/yudao-module-member/yudao-module-member-api/src/main/java/cn/iocoder/yudao/module/member/api/level/MemberLevelApi.java b/ruoyi-vue-pro-master/yudao-module-member/yudao-module-member-api/src/main/java/cn/iocoder/yudao/module/member/api/level/MemberLevelApi.java index 222e667..9c0d62c 100644 --- a/ruoyi-vue-pro-master/yudao-module-member/yudao-module-member-api/src/main/java/cn/iocoder/yudao/module/member/api/level/MemberLevelApi.java +++ b/ruoyi-vue-pro-master/yudao-module-member/yudao-module-member-api/src/main/java/cn/iocoder/yudao/module/member/api/level/MemberLevelApi.java @@ -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 getLevelList(Collection ids); + + /** + * 获得开启状态的会员等级列表 + * + * @return 会员等级列表 + */ + List getEnableLevelList(); } diff --git a/ruoyi-vue-pro-master/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/api/level/MemberLevelApiImpl.java b/ruoyi-vue-pro-master/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/api/level/MemberLevelApiImpl.java index 8a6e566..c3f854a 100644 --- a/ruoyi-vue-pro-master/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/api/level/MemberLevelApiImpl.java +++ b/ruoyi-vue-pro-master/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/api/level/MemberLevelApiImpl.java @@ -52,4 +52,9 @@ public class MemberLevelApiImpl implements MemberLevelApi { return BeanUtils.toBean(memberLevelService.getLevelList(ids),MemberLevelRespDTO.class); } + @Override + public List getEnableLevelList() { + return BeanUtils.toBean(memberLevelService.getEnableLevelList(),MemberLevelRespDTO.class); + } + } diff --git a/ruoyi-vue-pro-master/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/service/user/MemberUserServiceImpl.java b/ruoyi-vue-pro-master/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/service/user/MemberUserServiceImpl.java index 24068b0..25a8be5 100644 --- a/ruoyi-vue-pro-master/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/service/user/MemberUserServiceImpl.java +++ b/ruoyi-vue-pro-master/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/service/user/MemberUserServiceImpl.java @@ -585,8 +585,14 @@ public class MemberUserServiceImpl implements MemberUserService { .ge(BrokerageUserDO::getLevel, memberLevelDO.getLevel()) .eq(BrokerageUserDO::getDeleted, 0) ); + //查询会员邀请记录下级会员 + List brokerageUserDOS1 = brokerageUserMapper.selectList(new LambdaQueryWrapperX() + .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) diff --git a/ruoyi-vue-pro-master/yudao-server/src/main/resources/application.yaml b/ruoyi-vue-pro-master/yudao-server/src/main/resources/application.yaml index c076190..1c5d506 100644 --- a/ruoyi-vue-pro-master/yudao-server/src/main/resources/application.yaml +++ b/ruoyi-vue-pro-master/yudao-server/src/main/resources/application.yaml @@ -3,8 +3,8 @@ spring: name: yudao-server profiles: - active: dev -# active: local +# active: dev + active: local main: allow-circular-references: true # 允许循环依赖,因为项目是三层架构,无法避免这个情况。 diff --git a/yudao-ui-admin-vue3-master/src/views/Login/SocialLogin.vue b/yudao-ui-admin-vue3-master/src/views/Login/SocialLogin.vue index 35e9cd6..ac6ae60 100644 --- a/yudao-ui-admin-vue3-master/src/views/Login/SocialLogin.vue +++ b/yudao-ui-admin-vue3-master/src/views/Login/SocialLogin.vue @@ -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 } diff --git a/yudao-ui-admin-vue3-master/src/views/Login/components/LoginForm.vue b/yudao-ui-admin-vue3-master/src/views/Login/components/LoginForm.vue index 3703244..662fd1b 100644 --- a/yudao-ui-admin-vue3-master/src/views/Login/components/LoginForm.vue +++ b/yudao-ui-admin-vue3-master/src/views/Login/components/LoginForm.vue @@ -22,6 +22,7 @@ :placeholder="t('login.tenantNamePlaceholder')" :prefix-icon="iconHouse" link + disabled type="primary" /> diff --git a/yudao-ui-admin-vue3-master/src/views/mall/trade/brokerage/user/BrokerageUserListDialog.vue b/yudao-ui-admin-vue3-master/src/views/mall/trade/brokerage/user/BrokerageUserListDialog.vue index 87dc8f6..8e8f0bf 100644 --- a/yudao-ui-admin-vue3-master/src/views/mall/trade/brokerage/user/BrokerageUserListDialog.vue +++ b/yudao-ui-admin-vue3-master/src/views/mall/trade/brokerage/user/BrokerageUserListDialog.vue @@ -44,6 +44,7 @@ + +