修改了注册接口

This commit is contained in:
chen-xin-zhi 2025-05-16 11:19:36 +08:00
parent 72d4be7ed7
commit c886edf946
4 changed files with 9 additions and 13 deletions

BIN
blank.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 93 KiB

View File

@ -1,6 +1,7 @@
package com.greenorange.promotion.controller.project; package com.greenorange.promotion.controller.project;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.support.SFunction;
import com.greenorange.promotion.annotation.RequiresPermission; import com.greenorange.promotion.annotation.RequiresPermission;
import com.greenorange.promotion.annotation.SysLog; import com.greenorange.promotion.annotation.SysLog;
import com.greenorange.promotion.common.BaseResponse; import com.greenorange.promotion.common.BaseResponse;
@ -79,10 +80,7 @@ public class ProjectCommissionController {
// @SysLog(title = "项目明细抽佣管理", content = "小程序用户查看查询项目的抽佣情况") // @SysLog(title = "项目明细抽佣管理", content = "小程序用户查看查询项目的抽佣情况")
public BaseResponse<List<ProjectCommissionVO>> queryProjectCommission(HttpServletRequest request) { public BaseResponse<List<ProjectCommissionVO>> queryProjectCommission(HttpServletRequest request) {
Long userId = (Long) request.getAttribute("userId"); Long userId = (Long) request.getAttribute("userId");
LambdaQueryWrapper<ProjectCommission> lambdaQueryWrapper = new LambdaQueryWrapper<>(); List<ProjectCommission> projectCommissionList = commonService.findByFieldEqTargetField(ProjectCommission::getUserId, userId, projectCommissionService);
lambdaQueryWrapper.eq(ProjectCommission::getUserId, userId);
List<ProjectCommission> projectCommissionList = projectCommissionService.list(lambdaQueryWrapper);
List<ProjectDetail> projectDetailList = commonService.findByFieldInTargetField(projectCommissionList, projectDetailService, ProjectCommission::getProjectDetailId, ProjectDetail::getId); List<ProjectDetail> projectDetailList = commonService.findByFieldInTargetField(projectCommissionList, projectDetailService, ProjectCommission::getProjectDetailId, ProjectDetail::getId);
// 封装Map集合项目明细id项目明细名称 // 封装Map集合项目明细id项目明细名称
Map<Long, String> projectDetailMap = new HashMap<>(); Map<Long, String> projectDetailMap = new HashMap<>();
@ -155,10 +153,8 @@ public class ProjectCommissionController {
// 批量更新下级用户的项目明细抽佣比例 // 批量更新下级用户的项目明细抽佣比例
Long userId = (Long) request.getAttribute("userId"); Long userId = (Long) request.getAttribute("userId");
LambdaQueryWrapper<SubUserProjectCommission> lambdaQueryWrapper = new LambdaQueryWrapper<>(); Map<SFunction<SubUserProjectCommission, ?>, Object> fieldConditions = Map.of(SubUserProjectCommission::getProjectDetailId, projectDetailId, SubUserProjectCommission::getUserId, userId);
lambdaQueryWrapper.eq(SubUserProjectCommission::getProjectDetailId, projectDetailId); List<SubUserProjectCommission> subUserProjectCommissionList = commonService.findByFieldEqTargetFields(fieldConditions, subUserProjectCommissionService);
lambdaQueryWrapper.eq(SubUserProjectCommission::getUserId, userId);
List<SubUserProjectCommission> subUserProjectCommissionList = subUserProjectCommissionService.list(lambdaQueryWrapper);
for (SubUserProjectCommission subUserProjectCommission : subUserProjectCommissionList) { for (SubUserProjectCommission subUserProjectCommission : subUserProjectCommissionList) {
subUserProjectCommission.setCurrentCommissionRate(currentCommissionRate); subUserProjectCommission.setCurrentCommissionRate(currentCommissionRate);
} }

View File

@ -277,11 +277,11 @@ public class UserInfoServiceImpl extends ServiceImpl<UserInfoMapper, UserInfo>
public String getVerificationCode(String phoneNumber) { public String getVerificationCode(String phoneNumber) {
ThrowUtils.throwIf(RegexUtils.isPhoneInvalid(phoneNumber), ErrorCode.PARAMS_ERROR, "手机号格式错误"); ThrowUtils.throwIf(RegexUtils.isPhoneInvalid(phoneNumber), ErrorCode.PARAMS_ERROR, "手机号格式错误");
// 判断手机号是否已注册 // // 判断手机号是否已注册
LambdaQueryWrapper<UserInfo> lambdaQueryWrapper = new LambdaQueryWrapper<>(); // LambdaQueryWrapper<UserInfo> lambdaQueryWrapper = new LambdaQueryWrapper<>();
lambdaQueryWrapper.eq(UserInfo::getPhoneNumber, phoneNumber); // lambdaQueryWrapper.eq(UserInfo::getPhoneNumber, phoneNumber);
UserInfo userInfo = this.getOne(lambdaQueryWrapper); // UserInfo userInfo = this.getOne(lambdaQueryWrapper);
ThrowUtils.throwIf(userInfo == null, ErrorCode.OPERATION_ERROR, "手机号未注册"); // ThrowUtils.throwIf(userInfo == null, ErrorCode.OPERATION_ERROR, "手机号未注册");
String verificationCode = SendSmsUtil.getVerificationCode(phoneNumber); String verificationCode = SendSmsUtil.getVerificationCode(phoneNumber);
ThrowUtils.throwIf(verificationCode == null, ErrorCode.OPERATION_ERROR, "验证码获取失败"); ThrowUtils.throwIf(verificationCode == null, ErrorCode.OPERATION_ERROR, "验证码获取失败");