已完成小程序端的项目查询
This commit is contained in:
parent
4d14f5e04e
commit
2e33a08a33
|
@ -1,32 +1,14 @@
|
||||||
package com.greenorange.promotion.aop;
|
package com.greenorange.promotion.aop;
|
||||||
|
|
||||||
import cn.hutool.core.date.DateUtil;
|
|
||||||
import com.auth0.jwt.JWT;
|
|
||||||
import com.auth0.jwt.exceptions.JWTDecodeException;
|
|
||||||
import com.auth0.jwt.interfaces.Claim;
|
|
||||||
import com.auth0.jwt.interfaces.DecodedJWT;
|
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
||||||
import com.baomidou.mybatisplus.core.toolkit.StringUtils;
|
|
||||||
import com.greenorange.promotion.annotation.RequiresPermission;
|
import com.greenorange.promotion.annotation.RequiresPermission;
|
||||||
import com.greenorange.promotion.common.ErrorCode;
|
import com.greenorange.promotion.service.userInfo.UserInfoService;
|
||||||
import com.greenorange.promotion.exception.ThrowUtils;
|
|
||||||
import com.greenorange.promotion.model.entity.UserInfo;
|
|
||||||
import com.greenorange.promotion.model.enums.UserRoleEnum;
|
|
||||||
import com.greenorange.promotion.service.user.UserInfoService;
|
|
||||||
import com.greenorange.promotion.utils.JWTUtils;
|
import com.greenorange.promotion.utils.JWTUtils;
|
||||||
import jakarta.annotation.Resource;
|
import jakarta.annotation.Resource;
|
||||||
import jakarta.servlet.http.HttpServletRequest;
|
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.apache.catalina.User;
|
|
||||||
import org.aspectj.lang.ProceedingJoinPoint;
|
import org.aspectj.lang.ProceedingJoinPoint;
|
||||||
import org.aspectj.lang.annotation.Around;
|
import org.aspectj.lang.annotation.Around;
|
||||||
import org.aspectj.lang.annotation.Aspect;
|
import org.aspectj.lang.annotation.Aspect;
|
||||||
import org.springframework.stereotype.Component;
|
import org.springframework.stereotype.Component;
|
||||||
import org.springframework.web.context.request.RequestContextHolder;
|
|
||||||
import org.springframework.web.context.request.ServletRequestAttributes;
|
|
||||||
|
|
||||||
import java.util.Date;
|
|
||||||
import java.util.Objects;
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -4,21 +4,25 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
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;
|
||||||
|
import com.greenorange.promotion.common.ErrorCode;
|
||||||
import com.greenorange.promotion.common.ResultUtils;
|
import com.greenorange.promotion.common.ResultUtils;
|
||||||
import com.greenorange.promotion.constant.UserConstant;
|
import com.greenorange.promotion.constant.UserConstant;
|
||||||
|
import com.greenorange.promotion.exception.ThrowUtils;
|
||||||
import com.greenorange.promotion.model.dto.CommonRequest;
|
import com.greenorange.promotion.model.dto.CommonRequest;
|
||||||
import com.greenorange.promotion.model.dto.project.ProjectUpdateRequest;
|
import com.greenorange.promotion.model.dto.projectCommission.ProjectCommissionUniteUpdateRequest;
|
||||||
import com.greenorange.promotion.model.dto.projectCommission.ProjectCommissionAddRequest;
|
|
||||||
import com.greenorange.promotion.model.dto.projectCommission.ProjectCommissionUpdateRequest;
|
import com.greenorange.promotion.model.dto.projectCommission.ProjectCommissionUpdateRequest;
|
||||||
import com.greenorange.promotion.model.entity.Project;
|
import com.greenorange.promotion.model.dto.subUserProjectCommission.SubUserProjectCommissionUpdateRequest;
|
||||||
import com.greenorange.promotion.model.entity.ProjectCommission;
|
import com.greenorange.promotion.model.entity.*;
|
||||||
import com.greenorange.promotion.model.entity.ProjectDetail;
|
|
||||||
import com.greenorange.promotion.model.vo.projectCommission.ProjectCommissionVO;
|
import com.greenorange.promotion.model.vo.projectCommission.ProjectCommissionVO;
|
||||||
import com.greenorange.promotion.model.vo.projectCommission.ProjectDetailCommissionVO;
|
import com.greenorange.promotion.model.vo.projectCommission.ProjectDetailCommissionVO;
|
||||||
|
import com.greenorange.promotion.model.vo.subUserProjectCommission.SubUserProjectCommissionVO;
|
||||||
|
import com.greenorange.promotion.model.vo.subUserProjectCommission.SubUserProjectDetailCommissionVO;
|
||||||
import com.greenorange.promotion.service.common.CommonService;
|
import com.greenorange.promotion.service.common.CommonService;
|
||||||
import com.greenorange.promotion.service.project.ProjectCommissionService;
|
import com.greenorange.promotion.service.project.ProjectCommissionService;
|
||||||
import com.greenorange.promotion.service.project.ProjectDetailService;
|
import com.greenorange.promotion.service.project.ProjectDetailService;
|
||||||
import com.greenorange.promotion.service.project.ProjectService;
|
import com.greenorange.promotion.service.project.ProjectService;
|
||||||
|
import com.greenorange.promotion.service.project.SubUserProjectCommissionService;
|
||||||
|
import com.greenorange.promotion.service.userInfo.UserInfoService;
|
||||||
import io.swagger.v3.oas.annotations.Operation;
|
import io.swagger.v3.oas.annotations.Operation;
|
||||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||||
import jakarta.annotation.Resource;
|
import jakarta.annotation.Resource;
|
||||||
|
@ -49,6 +53,9 @@ public class ProjectCommissionController {
|
||||||
@Resource
|
@Resource
|
||||||
private ProjectCommissionService projectCommissionService;
|
private ProjectCommissionService projectCommissionService;
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private SubUserProjectCommissionService subUserProjectCommissionService;
|
||||||
|
|
||||||
@Resource
|
@Resource
|
||||||
private CommonService commonService;
|
private CommonService commonService;
|
||||||
|
|
||||||
|
@ -58,12 +65,15 @@ public class ProjectCommissionController {
|
||||||
@Resource
|
@Resource
|
||||||
private ProjectDetailService projectDetailService;
|
private ProjectDetailService projectDetailService;
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private UserInfoService userInfoService;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 小程序用户查看查询项目的抽佣情况
|
* 小程序用户查看查询项目的抽佣情况
|
||||||
* @return 项目抽佣比例列表
|
* @return 项目抽佣列表
|
||||||
*/
|
*/
|
||||||
@PostMapping("query/rate")
|
@PostMapping("query/commission")
|
||||||
@Operation(summary = "小程序用户查看查询项目的抽佣情况", description = "参数:无,权限:管理员,方法名:queryProjectCommission")
|
@Operation(summary = "小程序用户查看查询项目的抽佣情况", description = "参数:无,权限:管理员,方法名:queryProjectCommission")
|
||||||
@RequiresPermission(mustRole = UserConstant.DEFAULT_ROLE)
|
@RequiresPermission(mustRole = UserConstant.DEFAULT_ROLE)
|
||||||
@SysLog(title = "项目明细抽佣管理", content = "小程序用户查看查询项目的抽佣情况")
|
@SysLog(title = "项目明细抽佣管理", content = "小程序用户查看查询项目的抽佣情况")
|
||||||
|
@ -76,8 +86,11 @@ public class ProjectCommissionController {
|
||||||
List<ProjectDetail> projectDetailList = commonService.findByFieldInTargetField(projectCommissionList, projectDetailService, ProjectCommission::getProjectDetailId, "id");
|
List<ProjectDetail> projectDetailList = commonService.findByFieldInTargetField(projectCommissionList, projectDetailService, ProjectCommission::getProjectDetailId, "id");
|
||||||
// 封装Map集合(键:项目明细id,值:项目明细名称)
|
// 封装Map集合(键:项目明细id,值:项目明细名称)
|
||||||
Map<Long, String> projectDetailMap = new HashMap<>();
|
Map<Long, String> projectDetailMap = new HashMap<>();
|
||||||
|
// 封装Map集合(键:项目明细id,值:项目明细最大抽佣比例)
|
||||||
|
Map<Long, BigDecimal> rateMap = new HashMap<>();
|
||||||
for (ProjectDetail projectDetail : projectDetailList) {
|
for (ProjectDetail projectDetail : projectDetailList) {
|
||||||
projectDetailMap.put(projectDetail.getId(), projectDetail.getProjectDetailName());
|
projectDetailMap.put(projectDetail.getId(), projectDetail.getProjectDetailName());
|
||||||
|
rateMap.put(projectDetail.getId(), projectDetail.getMaxCommissionRate());
|
||||||
}
|
}
|
||||||
// 封装项目明细抽佣列表
|
// 封装项目明细抽佣列表
|
||||||
List<ProjectDetailCommissionVO> projectDetailCommissionVOList = new ArrayList<>();
|
List<ProjectDetailCommissionVO> projectDetailCommissionVOList = new ArrayList<>();
|
||||||
|
@ -86,8 +99,10 @@ public class ProjectCommissionController {
|
||||||
BigDecimal myUnitPrice = projectCommission.getMyUnitPrice();
|
BigDecimal myUnitPrice = projectCommission.getMyUnitPrice();
|
||||||
BigDecimal currentCommissionRate = projectCommission.getCurrentCommissionRate();
|
BigDecimal currentCommissionRate = projectCommission.getCurrentCommissionRate();
|
||||||
String projectDetailName = projectDetailMap.get(projectDetailId);
|
String projectDetailName = projectDetailMap.get(projectDetailId);
|
||||||
|
BigDecimal maxCommissionRate = rateMap.get(projectDetailId);
|
||||||
ProjectDetailCommissionVO projectDetailCommissionVO = commonService.copyProperties(projectCommission, ProjectDetailCommissionVO.class);
|
ProjectDetailCommissionVO projectDetailCommissionVO = commonService.copyProperties(projectCommission, ProjectDetailCommissionVO.class);
|
||||||
projectDetailCommissionVO.setProjectDetailName(projectDetailName);
|
projectDetailCommissionVO.setProjectDetailName(projectDetailName);
|
||||||
|
projectDetailCommissionVO.setMaxCommissionRate(maxCommissionRate);
|
||||||
BigDecimal agentUnitPrice = myUnitPrice.multiply(BigDecimal.ONE.subtract(currentCommissionRate));
|
BigDecimal agentUnitPrice = myUnitPrice.multiply(BigDecimal.ONE.subtract(currentCommissionRate));
|
||||||
projectDetailCommissionVO.setAgentUnitPrice(agentUnitPrice);
|
projectDetailCommissionVO.setAgentUnitPrice(agentUnitPrice);
|
||||||
projectDetailCommissionVOList.add(projectDetailCommissionVO);
|
projectDetailCommissionVOList.add(projectDetailCommissionVO);
|
||||||
|
@ -100,9 +115,10 @@ public class ProjectCommissionController {
|
||||||
if (pdcList == null) {
|
if (pdcList == null) {
|
||||||
pdcList = new ArrayList<>();
|
pdcList = new ArrayList<>();
|
||||||
}
|
}
|
||||||
|
pdcList.add(projectDetailCommissionVO);
|
||||||
pdcMap.put(projectId, pdcList);
|
pdcMap.put(projectId, pdcList);
|
||||||
}
|
}
|
||||||
// 封装项目抽佣比例列表
|
// 封装项目抽佣列表
|
||||||
List<Project> projectList = commonService.findByFieldInTargetField(projectCommissionList, projectService, ProjectCommission::getProjectId, "id");
|
List<Project> projectList = commonService.findByFieldInTargetField(projectCommissionList, projectService, ProjectCommission::getProjectId, "id");
|
||||||
List<ProjectCommissionVO> projectCommissionVOList = new ArrayList<>();
|
List<ProjectCommissionVO> projectCommissionVOList = new ArrayList<>();
|
||||||
for (Project project : projectList) {
|
for (Project project : projectList) {
|
||||||
|
@ -118,119 +134,179 @@ public class ProjectCommissionController {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 小程序用户修改项目的抽佣比例
|
* 小程序用户修改项目的抽佣比例
|
||||||
* @param projectCommissionUpdateRequest 项目明细抽佣添加请求体
|
* @param projectCommissionUpdateRequest 项目明细抽佣更新请求体
|
||||||
* @return 是否添加成功
|
* @return 是否添加成功
|
||||||
*/
|
*/
|
||||||
@PostMapping("update/rate")
|
@PostMapping("update/rate")
|
||||||
@Operation(summary = "小程序用户修改项目的抽佣比例", description = "参数:项目明细抽佣添加请求体,权限:管理员,方法名:updateProjectCommissionRate")
|
@Operation(summary = "小程序用户修改项目的抽佣比例", description = "参数:项目明细抽佣更新请求体,权限:管理员,方法名:updateProjectCommissionRate")
|
||||||
@RequiresPermission(mustRole = UserConstant.DEFAULT_ROLE)
|
@RequiresPermission(mustRole = UserConstant.DEFAULT_ROLE)
|
||||||
@SysLog(title = "项目明细抽佣管理", content = "小程序用户修改项目的抽佣比例")
|
@SysLog(title = "项目明细抽佣管理", content = "小程序用户修改项目的抽佣比例")
|
||||||
public BaseResponse<Boolean> updateProjectCommissionRate(@Valid @RequestBody ProjectCommissionUpdateRequest projectCommissionUpdateRequest) {
|
public BaseResponse<Boolean> updateProjectCommissionRate(@Valid @RequestBody ProjectCommissionUpdateRequest projectCommissionUpdateRequest, HttpServletRequest request) {
|
||||||
ProjectCommission projectCommission = commonService.copyProperties(projectCommissionUpdateRequest, ProjectCommission.class);
|
Long id = projectCommissionUpdateRequest.getId();
|
||||||
projectCommissionService.save(projectCommission);
|
BigDecimal currentCommissionRate = projectCommissionUpdateRequest.getCurrentCommissionRate();
|
||||||
|
// 校验当前抽佣比例不能大于最大抽佣比例
|
||||||
|
ProjectCommission projectCommission = projectCommissionService.getById(id);
|
||||||
|
Long projectDetailId = projectCommission.getProjectDetailId();
|
||||||
|
ProjectDetail projectDetail = projectDetailService.getById(projectDetailId);
|
||||||
|
BigDecimal maxCommissionRate = projectDetail.getMaxCommissionRate();
|
||||||
|
ThrowUtils.throwIf(currentCommissionRate.compareTo(maxCommissionRate) > 0, ErrorCode.OPERATION_ERROR, "当前抽佣比例不能大于最大抽佣比例");
|
||||||
|
projectCommission.setCurrentCommissionRate(currentCommissionRate);
|
||||||
|
projectCommissionService.updateById(projectCommission);
|
||||||
|
|
||||||
|
// 批量更新下级用户的项目明细抽佣比例
|
||||||
|
Long userId = (Long) request.getAttribute("userId");
|
||||||
|
LambdaQueryWrapper<SubUserProjectCommission> lambdaQueryWrapper = new LambdaQueryWrapper<>();
|
||||||
|
lambdaQueryWrapper.eq(SubUserProjectCommission::getProjectDetailId, projectDetailId);
|
||||||
|
lambdaQueryWrapper.eq(SubUserProjectCommission::getUserId, userId);
|
||||||
|
List<SubUserProjectCommission> subUserProjectCommissionList = subUserProjectCommissionService.list(lambdaQueryWrapper);
|
||||||
|
for (SubUserProjectCommission subUserProjectCommission : subUserProjectCommissionList) {
|
||||||
|
subUserProjectCommission.setCurrentCommissionRate(currentCommissionRate);
|
||||||
|
}
|
||||||
|
subUserProjectCommissionService.updateBatchById(subUserProjectCommissionList);
|
||||||
return ResultUtils.success(true);
|
return ResultUtils.success(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
//
|
/**
|
||||||
// /**
|
* 小程序用户查看下级用户的项目明细抽佣情况
|
||||||
// * web端管理员添加项目明细抽佣
|
* @param commonRequest 项目id
|
||||||
// * @param projectCommissionAddRequest 项目明细抽佣添加请求体
|
* @return 下级用户的项目明细抽佣列表
|
||||||
// * @return 是否添加成功
|
*/
|
||||||
// */
|
@PostMapping("query/sub/commission")
|
||||||
// @PostMapping("add")
|
@Operation(summary = "小程序用户查看下级用户的项目明细抽佣情况", description = "参数:项目明细抽佣添加请求体,权限:管理员,方法名:querySubUserProjectCommission")
|
||||||
// @Operation(summary = "web端管理员添加项目明细抽佣", description = "参数:项目明细抽佣添加请求体,权限:管理员,方法名:addProjectCommission")
|
@RequiresPermission(mustRole = UserConstant.DEFAULT_ROLE)
|
||||||
// @RequiresPermission(mustRole = UserConstant.ADMIN_ROLE)
|
@SysLog(title = "项目明细抽佣管理", content = "小程序用户查看下级用户的项目明细抽佣情况")
|
||||||
// @SysLog(title = "项目明细抽佣管理", content = "web端管理员添加项目明细抽佣")
|
public BaseResponse<List<SubUserProjectCommissionVO>> querySubUserProjectCommission(@Valid @RequestBody CommonRequest commonRequest, HttpServletRequest request) {
|
||||||
// public BaseResponse<Boolean> addProjectCommission(@Valid @RequestBody ProjectCommissionAddRequest projectCommissionAddRequest) {
|
Long projectId = commonRequest.getId();
|
||||||
// ProjectCommission projectCommission = commonService.copyProperties(projectCommissionAddRequest, ProjectCommission.class);
|
Long userId = (Long) request.getAttribute("userId");
|
||||||
// projectCommissionService.save(projectCommission);
|
LambdaQueryWrapper<SubUserProjectCommission> lambdaQueryWrapper = new LambdaQueryWrapper<>();
|
||||||
// return ResultUtils.success(true);
|
lambdaQueryWrapper.eq(SubUserProjectCommission::getProjectId, projectId);
|
||||||
// }
|
lambdaQueryWrapper.eq(SubUserProjectCommission::getUserId, userId);
|
||||||
//
|
List<SubUserProjectCommission> subUserProjectCommissionList = subUserProjectCommissionService.list(lambdaQueryWrapper);
|
||||||
// /**
|
|
||||||
// * web端管理员根据id修改项目明细抽佣信息
|
List<ProjectDetail> projectDetailList = commonService.findByFieldInTargetField(subUserProjectCommissionList, projectDetailService, SubUserProjectCommission::getProjectDetailId, "id");
|
||||||
// * @param projectCommissionUpdateRequest 项目明细抽佣更新请求体
|
// 封装Map集合(键:项目明细id,值:项目明细名称)
|
||||||
// * @return 是否更新成功
|
Map<Long, String> projectDetailMap = new HashMap<>();
|
||||||
// */
|
// 封装Map集合(键:项目明细id,值:项目明细最大抽佣比例)
|
||||||
// @PostMapping("update")
|
Map<Long, BigDecimal> rateMap = new HashMap<>();
|
||||||
// @Operation(summary = "web端管理员更新项目明细抽佣", description = "参数:项目明细抽佣更新请求体,权限:管理员,方法名:updateProjectCommission")
|
for (ProjectDetail projectDetail : projectDetailList) {
|
||||||
// @RequiresPermission(mustRole = UserConstant.ADMIN_ROLE)
|
projectDetailMap.put(projectDetail.getId(), projectDetail.getProjectDetailName());
|
||||||
// @SysLog(title = "项目明细抽佣管理", content = "web端管理员根据id修改项目明细抽佣信息")
|
rateMap.put(projectDetail.getId(), projectDetail.getMaxCommissionRate());
|
||||||
// public BaseResponse<Boolean> updateProjectCommission(@Valid @RequestBody ProjectCommissionUpdateRequest projectCommissionUpdateRequest) {
|
}
|
||||||
// ProjectCommission projectCommission = commonService.copyProperties(projectCommissionUpdateRequest, ProjectCommission.class);
|
// 封装下级用户项目明细抽佣列表
|
||||||
// projectCommissionService.updateById(projectCommission);
|
List<SubUserProjectDetailCommissionVO> subUserProjectDetailCommissionVOList = new ArrayList<>();
|
||||||
// return ResultUtils.success(true);
|
for (SubUserProjectCommission subUserProjectCommission : subUserProjectCommissionList) {
|
||||||
// }
|
Long projectDetailId = subUserProjectCommission.getProjectDetailId();
|
||||||
//
|
String projectDetailName = projectDetailMap.get(projectDetailId);
|
||||||
// /**
|
BigDecimal maxCommissionRate = rateMap.get(projectDetailId);
|
||||||
// * web端管理员根据id删除项目明细抽佣
|
SubUserProjectDetailCommissionVO subUserProjectDetailCommissionVO = commonService.copyProperties(subUserProjectCommission, SubUserProjectDetailCommissionVO.class);
|
||||||
// * @param commonRequest 项目明细抽佣删除请求体
|
subUserProjectDetailCommissionVO.setProjectDetailName(projectDetailName);
|
||||||
// * @return 是否删除成功
|
subUserProjectDetailCommissionVO.setMaxCommissionRate(maxCommissionRate);
|
||||||
// */
|
BigDecimal myUnitPrice = subUserProjectCommission.getMyUnitPrice();
|
||||||
// @PostMapping("delete")
|
BigDecimal currentCommissionRate = subUserProjectCommission.getCurrentCommissionRate();
|
||||||
// @Operation(summary = "web端管理员根据id删除项目明细抽佣", description = "参数:项目明细抽佣删除请求体,权限:管理员,方法名:delProjectCommission")
|
BigDecimal agentUnitPrice = myUnitPrice.multiply(BigDecimal.ONE.subtract(currentCommissionRate));
|
||||||
// @RequiresPermission(mustRole = UserConstant.ADMIN_ROLE)
|
subUserProjectDetailCommissionVO.setAgentUnitPrice(agentUnitPrice);
|
||||||
// @SysLog(title = "项目明细抽佣管理", content = "web端管理员根据id删除项目明细抽佣")
|
subUserProjectDetailCommissionVOList.add(subUserProjectDetailCommissionVO);
|
||||||
// public BaseResponse<Boolean> delProjectCommission(@Valid @RequestBody CommonRequest commonRequest) {
|
}
|
||||||
// Long id = commonRequest.getId();
|
// 封装Map集合(键:下级用户id,值:项目明细抽佣列表)
|
||||||
// projectCommissionService.removeById(id);
|
Map<Long, List<SubUserProjectDetailCommissionVO> > subPdcMap = new HashMap<>();
|
||||||
// return ResultUtils.success(true);
|
for (SubUserProjectDetailCommissionVO subUserProjectDetailCommissionVO : subUserProjectDetailCommissionVOList) {
|
||||||
// }
|
Long subUserId = subUserProjectDetailCommissionVO.getSubUserId();
|
||||||
//
|
List<SubUserProjectDetailCommissionVO> subUserProjectDetailCommissionVOS = subPdcMap.get(subUserId);
|
||||||
// /**
|
if (subUserProjectDetailCommissionVOS == null) {
|
||||||
// * web端管理员批量删除项目明细抽佣
|
subUserProjectDetailCommissionVOS = new ArrayList<>();
|
||||||
// * @param commonBatchRequest 项目明细抽佣批量删除请求体
|
}
|
||||||
// * @return 是否删除成功
|
subUserProjectDetailCommissionVOS.add(subUserProjectDetailCommissionVO);
|
||||||
// */
|
subPdcMap.put(subUserId, subUserProjectDetailCommissionVOS);
|
||||||
// @PostMapping("delBatch")
|
}
|
||||||
// @Operation(summary = "web端管理员批量删除项目明细抽佣", description = "参数:项目明细抽佣批量删除请求体,权限:管理员,方法名:delBatchProjectCommission")
|
// 封装下级用户项目抽佣列表
|
||||||
// @RequiresPermission(mustRole = UserConstant.ADMIN_ROLE)
|
LambdaQueryWrapper<UserInfo> userInfoLambdaQueryWrapper = new LambdaQueryWrapper<>();
|
||||||
// @SysLog(title = "项目明细抽佣管理", content = "web端管理员批量删除项目明细抽佣")
|
userInfoLambdaQueryWrapper.eq(UserInfo::getParentUserId, userId);
|
||||||
// public BaseResponse<Boolean> delBatchProjectCommission(@Valid @RequestBody CommonBatchRequest commonBatchRequest) {
|
List<UserInfo> userInfoList = userInfoService.list(userInfoLambdaQueryWrapper);
|
||||||
// List<Long> ids = commonBatchRequest.getIds();
|
List<SubUserProjectCommissionVO> subUserProjectCommissionVOList = new ArrayList<>();
|
||||||
// projectCommissionService.removeByIds(ids);
|
for (UserInfo userInfo : userInfoList) {
|
||||||
// return ResultUtils.success(true);
|
Long subUserId = userInfo.getId();
|
||||||
// }
|
String nickName = userInfo.getNickName();
|
||||||
//
|
List<SubUserProjectDetailCommissionVO> subUserProjectDetailCommissionVOS = subPdcMap.get(subUserId);
|
||||||
// /**
|
SubUserProjectCommissionVO subUserProjectCommissionVO = SubUserProjectCommissionVO.builder()
|
||||||
// * web端管理员根据id查询项目明细抽佣
|
.subUserId(subUserId)
|
||||||
// * @param commonRequest 项目明细抽佣查询请求体
|
.subUserNickName(nickName)
|
||||||
// * @return 项目明细抽佣信息
|
.subUserProjectDetailCommissionVOList(subUserProjectDetailCommissionVOS)
|
||||||
// */
|
.build();
|
||||||
// @PostMapping("queryById")
|
subUserProjectCommissionVOList.add(subUserProjectCommissionVO);
|
||||||
// @Operation(summary = "web端管理员根据id查询项目明细抽佣", description = "参数:项目明细抽佣查询请求体,权限:管理员,方法名:queryProjectCommissionById")
|
}
|
||||||
// @RequiresPermission(mustRole = UserConstant.ADMIN_ROLE)
|
return ResultUtils.success(subUserProjectCommissionVOList);
|
||||||
// @SysLog(title = "项目明细抽佣管理", content = "web端管理员根据id查询项目明细抽佣")
|
}
|
||||||
// public BaseResponse<ProjectCommissionVO> queryProjectCommissionById(@Valid @RequestBody CommonRequest commonRequest) {
|
|
||||||
// Long id = commonRequest.getId();
|
|
||||||
// ProjectCommission projectCommission = projectCommissionService.getById(id);
|
/**
|
||||||
// ThrowUtils.throwIf(projectCommission == null, ErrorCode.OPERATION_ERROR, "当前项目明细抽佣不存在");
|
* 小程序用户修改下级用户的项目明细抽佣比例
|
||||||
// ProjectCommissionVO projectCommissionVO = commonService.copyProperties(projectCommission, ProjectCommissionVO.class);
|
* @param subUserProjectCommissionUpdateRequest 下级用户项目明细抽佣更新请求体
|
||||||
// return ResultUtils.success(projectCommissionVO);
|
* @return 是否添加成功
|
||||||
// }
|
*/
|
||||||
//
|
@PostMapping("update/sub/rate")
|
||||||
// /**
|
@Operation(summary = "小程序用户修改下级用户的项目明细抽佣比例", description = "参数:下级用户项目明细抽佣更新请求体,权限:管理员,方法名:updateSubUserProjectCommissionRate")
|
||||||
// * Web端管理员分页查询项目明细抽佣
|
@RequiresPermission(mustRole = UserConstant.DEFAULT_ROLE)
|
||||||
// * @param projectCommissionQueryRequest 项目明细抽佣查询请求体
|
@SysLog(title = "项目明细抽佣管理", content = "小程序用户修改下级用户的项目明细抽佣比例")
|
||||||
// * @return 项目明细抽佣列表
|
public BaseResponse<Boolean> updateSubUserProjectCommissionRate(@Valid @RequestBody SubUserProjectCommissionUpdateRequest subUserProjectCommissionUpdateRequest) {
|
||||||
// */
|
Long id = subUserProjectCommissionUpdateRequest.getId();
|
||||||
// @PostMapping("page")
|
BigDecimal currentCommissionRate = subUserProjectCommissionUpdateRequest.getCurrentCommissionRate();
|
||||||
// @Operation(summary = "Web端管理员分页查询项目明细抽佣", description = "参数:项目明细抽佣查询请求体,权限:管理员,方法名:listProjectCommissionByPage")
|
// 校验当前抽佣比例不能大于最大抽佣比例
|
||||||
// @RequiresPermission(mustRole = UserConstant.ADMIN_ROLE)
|
SubUserProjectCommission subUserProjectCommission = subUserProjectCommissionService.getById(id);
|
||||||
// @SysLog(title = "项目明细抽佣管理", content = "Web端管理员分页查询项目明细抽佣")
|
Long projectDetailId = subUserProjectCommission.getProjectDetailId();
|
||||||
// public BaseResponse<Page<ProjectCommissionVO>> listProjectCommissionByPage(@Valid @RequestBody ProjectCommissionQueryRequest projectCommissionQueryRequest) {
|
ProjectDetail projectDetail = projectDetailService.getById(projectDetailId);
|
||||||
// long current = projectCommissionQueryRequest.getCurrent();
|
BigDecimal maxCommissionRate = projectDetail.getMaxCommissionRate();
|
||||||
// long pageSize = projectCommissionQueryRequest.getPageSize();
|
ThrowUtils.throwIf(currentCommissionRate.compareTo(maxCommissionRate) > 0, ErrorCode.OPERATION_ERROR, "当前抽佣比例不能大于最大抽佣比例");
|
||||||
// QueryWrapper<ProjectCommission> queryWrapper = projectCommissionService.getQueryWrapper(projectCommissionQueryRequest);
|
subUserProjectCommission.setCurrentCommissionRate(currentCommissionRate);
|
||||||
// Page<ProjectCommission> page = projectCommissionService.page(new Page<>(current, pageSize), queryWrapper);
|
subUserProjectCommissionService.updateById(subUserProjectCommission);
|
||||||
// List<ProjectCommission> projectCommissionList = page.getRecords();
|
return ResultUtils.success(true);
|
||||||
// List<ProjectCommissionVO> projectCommissionVOList = commonService.convertList(projectCommissionList, ProjectCommissionVO.class);
|
}
|
||||||
// Page<ProjectCommissionVO> voPage = new Page<>(current, pageSize);
|
|
||||||
// voPage.setRecords(projectCommissionVOList);
|
|
||||||
// voPage.setPages(page.getPages());
|
/**
|
||||||
// voPage.setTotal(page.getTotal());
|
* 小程序用户一键设置项目的的抽佣比例
|
||||||
// return ResultUtils.success(voPage);
|
* @param projectCommissionUniteUpdateRequest 统一抽佣比例
|
||||||
// }
|
* @return 是否添加成功
|
||||||
|
*/
|
||||||
|
@PostMapping("update/unite/rate")
|
||||||
|
@Operation(summary = "小程序用户一键设置项目的的抽佣比例", description = "参数:统一抽佣比例,权限:管理员,方法名:uniteProjectCommissionRate")
|
||||||
|
@RequiresPermission(mustRole = UserConstant.DEFAULT_ROLE)
|
||||||
|
@SysLog(title = "项目明细抽佣管理", content = "小程序用户一键设置项目的的抽佣比例")
|
||||||
|
public BaseResponse<Boolean> uniteProjectCommissionRate(@Valid @RequestBody ProjectCommissionUniteUpdateRequest projectCommissionUniteUpdateRequest, HttpServletRequest request) {
|
||||||
|
Long userId = (Long) request.getAttribute("userId");
|
||||||
|
BigDecimal uniteCommissionRate = projectCommissionUniteUpdateRequest.getUniteCommissionRate();
|
||||||
|
LambdaQueryWrapper<ProjectCommission> projectCommissionLambdaQueryWrapper = new LambdaQueryWrapper<>();
|
||||||
|
projectCommissionLambdaQueryWrapper.eq(ProjectCommission::getUserId, userId);
|
||||||
|
List<ProjectCommission> projectCommissionList = projectCommissionService.list(projectCommissionLambdaQueryWrapper);
|
||||||
|
|
||||||
|
List<ProjectDetail> projectDetailList = commonService.findByFieldInTargetField(projectCommissionList, projectDetailService, ProjectCommission::getProjectDetailId, "id");
|
||||||
|
// 封装map集合(键:项目明细id, 值:项目明细最大抽佣比例)
|
||||||
|
Map<Long, BigDecimal> map = new HashMap<>();
|
||||||
|
for (ProjectDetail projectDetail : projectDetailList) {
|
||||||
|
map.put(projectDetail.getId(), projectDetail.getMaxCommissionRate());
|
||||||
|
}
|
||||||
|
for (ProjectCommission projectCommission : projectCommissionList) {
|
||||||
|
Long projectDetailId = projectCommission.getProjectDetailId();
|
||||||
|
BigDecimal maxCommissionRate = map.get(projectDetailId);
|
||||||
|
BigDecimal setCommissionRate = uniteCommissionRate.compareTo(maxCommissionRate) > 0 ? maxCommissionRate : uniteCommissionRate;
|
||||||
|
projectCommission.setCurrentCommissionRate(setCommissionRate);
|
||||||
|
}
|
||||||
|
projectCommissionService.updateBatchById(projectCommissionList);
|
||||||
|
|
||||||
|
// 修改下级用户的项目明细抽佣比例
|
||||||
|
LambdaQueryWrapper<SubUserProjectCommission> subUserProjectCommissionLambdaQueryWrapper = new LambdaQueryWrapper<>();
|
||||||
|
subUserProjectCommissionLambdaQueryWrapper.eq(SubUserProjectCommission::getUserId, userId);
|
||||||
|
List<SubUserProjectCommission> subUserProjectCommissionList = subUserProjectCommissionService.list(subUserProjectCommissionLambdaQueryWrapper);
|
||||||
|
for (SubUserProjectCommission subUserProjectCommission : subUserProjectCommissionList) {
|
||||||
|
Long projectDetailId = subUserProjectCommission.getProjectDetailId();
|
||||||
|
BigDecimal maxCommissionRate = map.get(projectDetailId);
|
||||||
|
BigDecimal setCommissionRate = uniteCommissionRate.compareTo(maxCommissionRate) > 0 ? maxCommissionRate : uniteCommissionRate;
|
||||||
|
subUserProjectCommission.setCurrentCommissionRate(setCommissionRate);
|
||||||
|
}
|
||||||
|
subUserProjectCommissionService.updateBatchById(subUserProjectCommissionList);
|
||||||
|
return ResultUtils.success(true);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
|
@ -1,7 +1,6 @@
|
||||||
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.conditions.query.QueryWrapper;
|
|
||||||
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;
|
||||||
|
@ -9,11 +8,8 @@ import com.greenorange.promotion.common.ErrorCode;
|
||||||
import com.greenorange.promotion.common.ResultUtils;
|
import com.greenorange.promotion.common.ResultUtils;
|
||||||
import com.greenorange.promotion.constant.UserConstant;
|
import com.greenorange.promotion.constant.UserConstant;
|
||||||
import com.greenorange.promotion.exception.ThrowUtils;
|
import com.greenorange.promotion.exception.ThrowUtils;
|
||||||
import com.greenorange.promotion.model.dto.CommonBatchRequest;
|
|
||||||
import com.greenorange.promotion.model.dto.projectCommission.ProjectCommissionAddRequest;
|
import com.greenorange.promotion.model.dto.projectCommission.ProjectCommissionAddRequest;
|
||||||
import com.greenorange.promotion.model.dto.projectCommission.ProjectCommissionUpdateRequest;
|
|
||||||
import com.greenorange.promotion.model.dto.projectDetail.ProjectDetailAddRequest;
|
import com.greenorange.promotion.model.dto.projectDetail.ProjectDetailAddRequest;
|
||||||
import com.greenorange.promotion.model.dto.projectDetail.ProjectDetailQueryRequest;
|
|
||||||
import com.greenorange.promotion.model.dto.projectDetail.ProjectDetailUpdateRequest;
|
import com.greenorange.promotion.model.dto.projectDetail.ProjectDetailUpdateRequest;
|
||||||
import com.greenorange.promotion.model.dto.subUserProjectCommission.SubUserProjectCommissionAddRequest;
|
import com.greenorange.promotion.model.dto.subUserProjectCommission.SubUserProjectCommissionAddRequest;
|
||||||
import com.greenorange.promotion.model.entity.*;
|
import com.greenorange.promotion.model.entity.*;
|
||||||
|
@ -22,14 +18,13 @@ import com.greenorange.promotion.service.common.CommonService;
|
||||||
import com.greenorange.promotion.service.project.ProjectCommissionService;
|
import com.greenorange.promotion.service.project.ProjectCommissionService;
|
||||||
import com.greenorange.promotion.service.project.ProjectDetailService;
|
import com.greenorange.promotion.service.project.ProjectDetailService;
|
||||||
import com.greenorange.promotion.service.project.SubUserProjectCommissionService;
|
import com.greenorange.promotion.service.project.SubUserProjectCommissionService;
|
||||||
import com.greenorange.promotion.service.user.UserInfoService;
|
import com.greenorange.promotion.service.userInfo.UserInfoService;
|
||||||
import io.swagger.v3.oas.annotations.Operation;
|
import io.swagger.v3.oas.annotations.Operation;
|
||||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||||
import jakarta.annotation.Resource;
|
import jakarta.annotation.Resource;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.springframework.web.bind.annotation.PostMapping;
|
import org.springframework.web.bind.annotation.PostMapping;
|
||||||
import org.springframework.web.bind.annotation.RequestBody;
|
import org.springframework.web.bind.annotation.RequestBody;
|
||||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
||||||
import com.greenorange.promotion.model.dto.CommonRequest;
|
import com.greenorange.promotion.model.dto.CommonRequest;
|
||||||
import jakarta.validation.Valid;
|
import jakarta.validation.Valid;
|
||||||
import org.springframework.web.bind.annotation.RequestMapping;
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
|
|
|
@ -1,148 +0,0 @@
|
||||||
package com.greenorange.promotion.controller.project;
|
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
||||||
import com.greenorange.promotion.annotation.RequiresPermission;
|
|
||||||
import com.greenorange.promotion.annotation.SysLog;
|
|
||||||
import com.greenorange.promotion.common.BaseResponse;
|
|
||||||
import com.greenorange.promotion.common.ErrorCode;
|
|
||||||
import com.greenorange.promotion.common.ResultUtils;
|
|
||||||
import com.greenorange.promotion.constant.UserConstant;
|
|
||||||
import com.greenorange.promotion.exception.ThrowUtils;
|
|
||||||
import com.greenorange.promotion.model.dto.CommonBatchRequest;
|
|
||||||
import com.greenorange.promotion.model.dto.subUserProjectCommission.SubUserProjectCommissionAddRequest;
|
|
||||||
import com.greenorange.promotion.model.dto.subUserProjectCommission.SubUserProjectCommissionQueryRequest;
|
|
||||||
import com.greenorange.promotion.model.dto.subUserProjectCommission.SubUserProjectCommissionUpdateRequest;
|
|
||||||
import com.greenorange.promotion.model.entity.SubUserProjectCommission;
|
|
||||||
import com.greenorange.promotion.model.vo.subUserProjectCommission.SubUserProjectCommissionVO;
|
|
||||||
import com.greenorange.promotion.service.common.CommonService;
|
|
||||||
import com.greenorange.promotion.service.project.SubUserProjectCommissionService;
|
|
||||||
import io.swagger.v3.oas.annotations.Operation;
|
|
||||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
|
||||||
import jakarta.annotation.Resource;
|
|
||||||
import lombok.extern.slf4j.Slf4j;
|
|
||||||
import org.springframework.web.bind.annotation.PostMapping;
|
|
||||||
import org.springframework.web.bind.annotation.RequestBody;
|
|
||||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
||||||
import com.greenorange.promotion.model.dto.CommonRequest;
|
|
||||||
import jakarta.validation.Valid;
|
|
||||||
import org.springframework.web.bind.annotation.RequestMapping;
|
|
||||||
import org.springframework.web.bind.annotation.RestController;
|
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 下级用户项目明细抽佣 控制器
|
|
||||||
*/
|
|
||||||
@RestController
|
|
||||||
@RequestMapping("subUserProjectCommission")
|
|
||||||
@Slf4j
|
|
||||||
@Tag(name = "下级用户项目明细抽佣管理")
|
|
||||||
public class SubUserProjectCommissionController {
|
|
||||||
|
|
||||||
@Resource
|
|
||||||
private SubUserProjectCommissionService subUserProjectCommissionService;
|
|
||||||
|
|
||||||
@Resource
|
|
||||||
private CommonService commonService;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* web端管理员添加下级用户项目明细抽佣
|
|
||||||
* @param subUserProjectCommissionAddRequest 下级用户项目明细抽佣添加请求体
|
|
||||||
* @return 是否添加成功
|
|
||||||
*/
|
|
||||||
@PostMapping("add")
|
|
||||||
@Operation(summary = "web端管理员添加下级用户项目明细抽佣", description = "参数:下级用户项目明细抽佣添加请求体,权限:管理员,方法名:addSubUserProjectCommission")
|
|
||||||
@RequiresPermission(mustRole = UserConstant.ADMIN_ROLE)
|
|
||||||
@SysLog(title = "下级用户项目明细抽佣管理", content = "web端管理员添加下级用户项目明细抽佣")
|
|
||||||
public BaseResponse<Boolean> addSubUserProjectCommission(@Valid @RequestBody SubUserProjectCommissionAddRequest subUserProjectCommissionAddRequest) {
|
|
||||||
SubUserProjectCommission subUserProjectCommission = commonService.copyProperties(subUserProjectCommissionAddRequest, SubUserProjectCommission.class);
|
|
||||||
subUserProjectCommissionService.save(subUserProjectCommission);
|
|
||||||
return ResultUtils.success(true);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* web端管理员根据id修改下级用户项目明细抽佣信息
|
|
||||||
* @param subUserProjectCommissionUpdateRequest 下级用户项目明细抽佣更新请求体
|
|
||||||
* @return 是否更新成功
|
|
||||||
*/
|
|
||||||
@PostMapping("update")
|
|
||||||
@Operation(summary = "web端管理员更新下级用户项目明细抽佣", description = "参数:下级用户项目明细抽佣更新请求体,权限:管理员,方法名:updateSubUserProjectCommission")
|
|
||||||
@RequiresPermission(mustRole = UserConstant.ADMIN_ROLE)
|
|
||||||
@SysLog(title = "下级用户项目明细抽佣管理", content = "web端管理员根据id修改下级用户项目明细抽佣信息")
|
|
||||||
public BaseResponse<Boolean> updateSubUserProjectCommission(@Valid @RequestBody SubUserProjectCommissionUpdateRequest subUserProjectCommissionUpdateRequest) {
|
|
||||||
SubUserProjectCommission subUserProjectCommission = commonService.copyProperties(subUserProjectCommissionUpdateRequest, SubUserProjectCommission.class);
|
|
||||||
subUserProjectCommissionService.updateById(subUserProjectCommission);
|
|
||||||
return ResultUtils.success(true);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* web端管理员根据id删除下级用户项目明细抽佣
|
|
||||||
* @param commonRequest 下级用户项目明细抽佣删除请求体
|
|
||||||
* @return 是否删除成功
|
|
||||||
*/
|
|
||||||
@PostMapping("delete")
|
|
||||||
@Operation(summary = "web端管理员根据id删除下级用户项目明细抽佣", description = "参数:下级用户项目明细抽佣删除请求体,权限:管理员,方法名:delSubUserProjectCommission")
|
|
||||||
@RequiresPermission(mustRole = UserConstant.ADMIN_ROLE)
|
|
||||||
@SysLog(title = "下级用户项目明细抽佣管理", content = "web端管理员根据id删除下级用户项目明细抽佣")
|
|
||||||
public BaseResponse<Boolean> delSubUserProjectCommission(@Valid @RequestBody CommonRequest commonRequest) {
|
|
||||||
Long id = commonRequest.getId();
|
|
||||||
subUserProjectCommissionService.removeById(id);
|
|
||||||
return ResultUtils.success(true);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* web端管理员批量删除下级用户项目明细抽佣
|
|
||||||
* @param commonBatchRequest 下级用户项目明细抽佣批量删除请求体
|
|
||||||
* @return 是否删除成功
|
|
||||||
*/
|
|
||||||
@PostMapping("delBatch")
|
|
||||||
@Operation(summary = "web端管理员批量删除下级用户项目明细抽佣", description = "参数:下级用户项目明细抽佣批量删除请求体,权限:管理员,方法名:delBatchSubUserProjectCommission")
|
|
||||||
@RequiresPermission(mustRole = UserConstant.ADMIN_ROLE)
|
|
||||||
@SysLog(title = "下级用户项目明细抽佣管理", content = "web端管理员批量删除下级用户项目明细抽佣")
|
|
||||||
public BaseResponse<Boolean> delBatchSubUserProjectCommission(@Valid @RequestBody CommonBatchRequest commonBatchRequest) {
|
|
||||||
List<Long> ids = commonBatchRequest.getIds();
|
|
||||||
subUserProjectCommissionService.removeByIds(ids);
|
|
||||||
return ResultUtils.success(true);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* web端管理员根据id查询下级用户项目明细抽佣
|
|
||||||
* @param commonRequest 下级用户项目明细抽佣查询请求体
|
|
||||||
* @return 下级用户项目明细抽佣信息
|
|
||||||
*/
|
|
||||||
@PostMapping("queryById")
|
|
||||||
@Operation(summary = "web端管理员根据id查询下级用户项目明细抽佣", description = "参数:下级用户项目明细抽佣查询请求体,权限:管理员,方法名:querySubUserProjectCommissionById")
|
|
||||||
@RequiresPermission(mustRole = UserConstant.ADMIN_ROLE)
|
|
||||||
@SysLog(title = "下级用户项目明细抽佣管理", content = "web端管理员根据id查询下级用户项目明细抽佣")
|
|
||||||
public BaseResponse<SubUserProjectCommissionVO> querySubUserProjectCommissionById(@Valid @RequestBody CommonRequest commonRequest) {
|
|
||||||
Long id = commonRequest.getId();
|
|
||||||
SubUserProjectCommission subUserProjectCommission = subUserProjectCommissionService.getById(id);
|
|
||||||
ThrowUtils.throwIf(subUserProjectCommission == null, ErrorCode.OPERATION_ERROR, "当前下级用户项目明细抽佣不存在");
|
|
||||||
SubUserProjectCommissionVO subUserProjectCommissionVO = commonService.copyProperties(subUserProjectCommission, SubUserProjectCommissionVO.class);
|
|
||||||
return ResultUtils.success(subUserProjectCommissionVO);
|
|
||||||
}
|
|
||||||
|
|
||||||
// /**
|
|
||||||
// * Web端管理员分页查询下级用户项目明细抽佣
|
|
||||||
// * @param subUserProjectCommissionQueryRequest 下级用户项目明细抽佣查询请求体
|
|
||||||
// * @return 下级用户项目明细抽佣列表
|
|
||||||
// */
|
|
||||||
// @PostMapping("page")
|
|
||||||
// @Operation(summary = "Web端管理员分页查询下级用户项目明细抽佣", description = "参数:下级用户项目明细抽佣查询请求体,权限:管理员,方法名:listSubUserProjectCommissionByPage")
|
|
||||||
// @RequiresPermission(mustRole = UserConstant.ADMIN_ROLE)
|
|
||||||
// @SysLog(title = "下级用户项目明细抽佣管理", content = "Web端管理员分页查询下级用户项目明细抽佣")
|
|
||||||
// public BaseResponse<Page<SubUserProjectCommissionVO>> listSubUserProjectCommissionByPage(@Valid @RequestBody SubUserProjectCommissionQueryRequest subUserProjectCommissionQueryRequest) {
|
|
||||||
// long current = subUserProjectCommissionQueryRequest.getCurrent();
|
|
||||||
// long pageSize = subUserProjectCommissionQueryRequest.getPageSize();
|
|
||||||
// QueryWrapper<SubUserProjectCommission> queryWrapper = subUserProjectCommissionService.getQueryWrapper(subUserProjectCommissionQueryRequest);
|
|
||||||
// Page<SubUserProjectCommission> page = subUserProjectCommissionService.page(new Page<>(current, pageSize), queryWrapper);
|
|
||||||
// List<SubUserProjectCommission> subUserProjectCommissionList = page.getRecords();
|
|
||||||
// List<SubUserProjectCommissionVO> subUserProjectCommissionVOList = commonService.convertList(subUserProjectCommissionList, SubUserProjectCommissionVO.class);
|
|
||||||
// Page<SubUserProjectCommissionVO> voPage = new Page<>(current, pageSize);
|
|
||||||
// voPage.setRecords(subUserProjectCommissionVOList);
|
|
||||||
// voPage.setPages(page.getPages());
|
|
||||||
// voPage.setTotal(page.getTotal());
|
|
||||||
// return ResultUtils.success(voPage);
|
|
||||||
// }
|
|
||||||
}
|
|
|
@ -8,7 +8,6 @@ import com.greenorange.promotion.common.ErrorCode;
|
||||||
import com.greenorange.promotion.common.ResultUtils;
|
import com.greenorange.promotion.common.ResultUtils;
|
||||||
import com.greenorange.promotion.constant.UserConstant;
|
import com.greenorange.promotion.constant.UserConstant;
|
||||||
import com.greenorange.promotion.exception.ThrowUtils;
|
import com.greenorange.promotion.exception.ThrowUtils;
|
||||||
import com.greenorange.promotion.model.dto.CommonBatchRequest;
|
|
||||||
import com.greenorange.promotion.model.dto.CommonRequest;
|
import com.greenorange.promotion.model.dto.CommonRequest;
|
||||||
import com.greenorange.promotion.model.dto.projectSettlement.ProjectSettlementAddRequest;
|
import com.greenorange.promotion.model.dto.projectSettlement.ProjectSettlementAddRequest;
|
||||||
import com.greenorange.promotion.model.dto.projectSettlement.ProjectSettlementUpdateRequest;
|
import com.greenorange.promotion.model.dto.projectSettlement.ProjectSettlementUpdateRequest;
|
||||||
|
@ -18,8 +17,7 @@ import com.greenorange.promotion.service.common.CommonService;
|
||||||
import com.greenorange.promotion.service.project.PromoCodeApplyService;
|
import com.greenorange.promotion.service.project.PromoCodeApplyService;
|
||||||
import com.greenorange.promotion.service.settle.FundsChangeService;
|
import com.greenorange.promotion.service.settle.FundsChangeService;
|
||||||
import com.greenorange.promotion.service.settle.ProjectSettlementService;
|
import com.greenorange.promotion.service.settle.ProjectSettlementService;
|
||||||
import com.greenorange.promotion.service.user.UserInfoService;
|
import com.greenorange.promotion.service.userInfo.UserMainInfoService;
|
||||||
import com.greenorange.promotion.service.user.UserMainInfoService;
|
|
||||||
import io.swagger.v3.oas.annotations.Operation;
|
import io.swagger.v3.oas.annotations.Operation;
|
||||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||||
import jakarta.annotation.Resource;
|
import jakarta.annotation.Resource;
|
||||||
|
|
|
@ -5,33 +5,25 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||||
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;
|
||||||
import com.greenorange.promotion.common.ErrorCode;
|
|
||||||
import com.greenorange.promotion.common.ResultUtils;
|
import com.greenorange.promotion.common.ResultUtils;
|
||||||
import com.greenorange.promotion.constant.UserConstant;
|
import com.greenorange.promotion.constant.UserConstant;
|
||||||
import com.greenorange.promotion.exception.ThrowUtils;
|
|
||||||
import com.greenorange.promotion.model.dto.CommonBatchRequest;
|
|
||||||
import com.greenorange.promotion.model.dto.withdrawalApply.WithdrawalApplyAddRequest;
|
import com.greenorange.promotion.model.dto.withdrawalApply.WithdrawalApplyAddRequest;
|
||||||
import com.greenorange.promotion.model.dto.withdrawalApply.WithdrawalApplyQueryRequest;
|
import com.greenorange.promotion.model.dto.withdrawalApply.WithdrawalApplyQueryRequest;
|
||||||
import com.greenorange.promotion.model.dto.withdrawalApply.WithdrawalApplyUpdateRequest;
|
|
||||||
import com.greenorange.promotion.model.entity.FundsChange;
|
import com.greenorange.promotion.model.entity.FundsChange;
|
||||||
import com.greenorange.promotion.model.entity.UserInfo;
|
|
||||||
import com.greenorange.promotion.model.entity.WithdrawalApply;
|
import com.greenorange.promotion.model.entity.WithdrawalApply;
|
||||||
import com.greenorange.promotion.model.vo.fundsChange.FundsChangeVO;
|
import com.greenorange.promotion.model.vo.fundsChange.FundsChangeVO;
|
||||||
import com.greenorange.promotion.model.vo.withdrawalApply.WithdrawalApplyVO;
|
import com.greenorange.promotion.model.vo.withdrawalApply.WithdrawalApplyVO;
|
||||||
import com.greenorange.promotion.service.common.CommonService;
|
import com.greenorange.promotion.service.common.CommonService;
|
||||||
import com.greenorange.promotion.service.settle.FundsChangeService;
|
import com.greenorange.promotion.service.settle.FundsChangeService;
|
||||||
import com.greenorange.promotion.service.settle.WithdrawalApplyService;
|
import com.greenorange.promotion.service.settle.WithdrawalApplyService;
|
||||||
import com.greenorange.promotion.service.user.UserInfoService;
|
|
||||||
import io.swagger.v3.oas.annotations.Operation;
|
import io.swagger.v3.oas.annotations.Operation;
|
||||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||||
import jakarta.annotation.Resource;
|
import jakarta.annotation.Resource;
|
||||||
import jakarta.servlet.http.HttpServletRequest;
|
import jakarta.servlet.http.HttpServletRequest;
|
||||||
import lombok.With;
|
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.springframework.web.bind.annotation.PostMapping;
|
import org.springframework.web.bind.annotation.PostMapping;
|
||||||
import org.springframework.web.bind.annotation.RequestBody;
|
import org.springframework.web.bind.annotation.RequestBody;
|
||||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
import com.greenorange.promotion.model.dto.CommonRequest;
|
|
||||||
import jakarta.validation.Valid;
|
import jakarta.validation.Valid;
|
||||||
import org.springframework.web.bind.annotation.RequestMapping;
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
import org.springframework.web.bind.annotation.RestController;
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
|
|
|
@ -14,14 +14,14 @@ import com.greenorange.promotion.exception.ThrowUtils;
|
||||||
import com.greenorange.promotion.model.dto.CommonBatchRequest;
|
import com.greenorange.promotion.model.dto.CommonBatchRequest;
|
||||||
import com.greenorange.promotion.model.dto.CommonRequest;
|
import com.greenorange.promotion.model.dto.CommonRequest;
|
||||||
import com.greenorange.promotion.model.dto.CommonStringRequest;
|
import com.greenorange.promotion.model.dto.CommonStringRequest;
|
||||||
import com.greenorange.promotion.model.dto.user.*;
|
import com.greenorange.promotion.model.dto.userInfo.*;
|
||||||
import com.greenorange.promotion.model.entity.UserInfo;
|
import com.greenorange.promotion.model.entity.UserInfo;
|
||||||
import com.greenorange.promotion.model.entity.UserMainInfo;
|
import com.greenorange.promotion.model.entity.UserMainInfo;
|
||||||
import com.greenorange.promotion.model.vo.user.UserInfoVO;
|
import com.greenorange.promotion.model.vo.userInfo.UserInfoVO;
|
||||||
import com.greenorange.promotion.model.vo.userMainInfo.UserMainInfoVO;
|
import com.greenorange.promotion.model.vo.userMainInfo.UserMainInfoVO;
|
||||||
import com.greenorange.promotion.service.common.CommonService;
|
import com.greenorange.promotion.service.common.CommonService;
|
||||||
import com.greenorange.promotion.service.user.UserInfoService;
|
import com.greenorange.promotion.service.userInfo.UserInfoService;
|
||||||
import com.greenorange.promotion.service.user.UserMainInfoService;
|
import com.greenorange.promotion.service.userInfo.UserMainInfoService;
|
||||||
import com.greenorange.promotion.utils.JWTUtils;
|
import com.greenorange.promotion.utils.JWTUtils;
|
||||||
import io.swagger.v3.oas.annotations.Operation;
|
import io.swagger.v3.oas.annotations.Operation;
|
||||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||||
|
|
|
@ -13,10 +13,11 @@ import com.greenorange.promotion.model.dto.userMainInfo.UserMainInfoUpdateReques
|
||||||
import com.greenorange.promotion.model.entity.UserMainInfo;
|
import com.greenorange.promotion.model.entity.UserMainInfo;
|
||||||
import com.greenorange.promotion.model.vo.userMainInfo.UserMainInfoVO;
|
import com.greenorange.promotion.model.vo.userMainInfo.UserMainInfoVO;
|
||||||
import com.greenorange.promotion.service.common.CommonService;
|
import com.greenorange.promotion.service.common.CommonService;
|
||||||
import com.greenorange.promotion.service.user.UserMainInfoService;
|
import com.greenorange.promotion.service.userInfo.UserMainInfoService;
|
||||||
import io.swagger.v3.oas.annotations.Operation;
|
import io.swagger.v3.oas.annotations.Operation;
|
||||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||||
import jakarta.annotation.Resource;
|
import jakarta.annotation.Resource;
|
||||||
|
import jakarta.servlet.http.HttpServletRequest;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.springframework.web.bind.annotation.PostMapping;
|
import org.springframework.web.bind.annotation.PostMapping;
|
||||||
import org.springframework.web.bind.annotation.RequestBody;
|
import org.springframework.web.bind.annotation.RequestBody;
|
||||||
|
@ -43,6 +44,21 @@ public class UserMainInfoController {
|
||||||
@Resource
|
@Resource
|
||||||
private CommonService commonService;
|
private CommonService commonService;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 小程序用户查询团队信息
|
||||||
|
* @return 团队信息
|
||||||
|
*/
|
||||||
|
@PostMapping("query/team")
|
||||||
|
@Operation(summary = "小程序用户查询团队信息", description = "参数:用户主要信息添加请求体,权限:管理员,方法名:queryUserTeamInfo")
|
||||||
|
@RequiresPermission(mustRole = UserConstant.DEFAULT_ROLE)
|
||||||
|
@SysLog(title = "用户主要信息管理", content = "小程序用户查询团队信息")
|
||||||
|
public BaseResponse<Boolean> queryUserTeamInfo(HttpServletRequest request) {
|
||||||
|
Long userId = (Long) request.getAttribute("userId");
|
||||||
|
return ResultUtils.success(true);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* web端管理员添加用户主要信息
|
* web端管理员添加用户主要信息
|
||||||
* @param userMainInfoAddRequest 用户主要信息添加请求体
|
* @param userMainInfoAddRequest 用户主要信息添加请求体
|
||||||
|
|
|
@ -0,0 +1,25 @@
|
||||||
|
package com.greenorange.promotion.model.dto.projectCommission;
|
||||||
|
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import jakarta.validation.constraints.Min;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.io.Serial;
|
||||||
|
import java.io.Serializable;
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
public class ProjectCommissionUniteUpdateRequest implements Serializable {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 统一抽佣比例
|
||||||
|
*/
|
||||||
|
@Min(value = 0L, message = "抽佣比例不能小于0")
|
||||||
|
@Schema(description = "统一抽佣比例", example = "5")
|
||||||
|
private BigDecimal uniteCommissionRate;
|
||||||
|
|
||||||
|
|
||||||
|
@Serial
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
}
|
|
@ -15,11 +15,7 @@ import java.math.BigDecimal;
|
||||||
@Data
|
@Data
|
||||||
@Schema(description = "项目明细抽佣更新请求体", requiredProperties = {
|
@Schema(description = "项目明细抽佣更新请求体", requiredProperties = {
|
||||||
"id",
|
"id",
|
||||||
"projectDetailId",
|
"currentCommissionRate"
|
||||||
"myUnitPrice",
|
|
||||||
"currentCommissionRate",
|
|
||||||
"projectId",
|
|
||||||
"userId",
|
|
||||||
})
|
})
|
||||||
public class ProjectCommissionUpdateRequest implements Serializable {
|
public class ProjectCommissionUpdateRequest implements Serializable {
|
||||||
|
|
||||||
|
@ -30,39 +26,14 @@ public class ProjectCommissionUpdateRequest implements Serializable {
|
||||||
@Schema(description = "抽佣记录ID", example = "1")
|
@Schema(description = "抽佣记录ID", example = "1")
|
||||||
private Long id;
|
private Long id;
|
||||||
|
|
||||||
/**
|
|
||||||
* 项目明细ID
|
|
||||||
*/
|
|
||||||
@Min(value = 1L, message = "项目明细ID ID不能小于1")
|
|
||||||
@Schema(description = "项目明细ID", example = "1")
|
|
||||||
private Long projectDetailId;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 我的单价
|
|
||||||
*/
|
|
||||||
@Schema(description = "我的单价", example = "0.45")
|
|
||||||
private BigDecimal myUnitPrice;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 当前抽佣比例
|
* 当前抽佣比例
|
||||||
*/
|
*/
|
||||||
|
@Min(value = 0L, message = "抽佣比例不能小于0")
|
||||||
@Schema(description = "当前抽佣比例", example = "5")
|
@Schema(description = "当前抽佣比例", example = "5")
|
||||||
private BigDecimal currentCommissionRate;
|
private BigDecimal currentCommissionRate;
|
||||||
|
|
||||||
/**
|
|
||||||
* 项目ID
|
|
||||||
*/
|
|
||||||
@Min(value = 1L, message = "项目ID ID不能小于1")
|
|
||||||
@Schema(description = "项目ID", example = "1")
|
|
||||||
private Long projectId;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 用户ID
|
|
||||||
*/
|
|
||||||
@Min(value = 1L, message = "用户ID ID不能小于1")
|
|
||||||
@Schema(description = "用户ID", example = "1")
|
|
||||||
private Long userId;
|
|
||||||
|
|
||||||
|
|
||||||
@Serial
|
@Serial
|
||||||
private static final long serialVersionUID = 1L;
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
|
@ -15,12 +15,7 @@ import java.math.BigDecimal;
|
||||||
@Data
|
@Data
|
||||||
@Schema(description = "下级用户项目明细抽佣更新请求体", requiredProperties = {
|
@Schema(description = "下级用户项目明细抽佣更新请求体", requiredProperties = {
|
||||||
"id",
|
"id",
|
||||||
"projectDetailId",
|
|
||||||
"myUnitPrice",
|
|
||||||
"currentCommissionRate",
|
"currentCommissionRate",
|
||||||
"subUserId",
|
|
||||||
"projectId",
|
|
||||||
"userId",
|
|
||||||
})
|
})
|
||||||
public class SubUserProjectCommissionUpdateRequest implements Serializable {
|
public class SubUserProjectCommissionUpdateRequest implements Serializable {
|
||||||
|
|
||||||
|
@ -31,46 +26,12 @@ public class SubUserProjectCommissionUpdateRequest implements Serializable {
|
||||||
@Schema(description = "下级用户抽佣记录ID", example = "1")
|
@Schema(description = "下级用户抽佣记录ID", example = "1")
|
||||||
private Long id;
|
private Long id;
|
||||||
|
|
||||||
/**
|
|
||||||
* 项目明细ID
|
|
||||||
*/
|
|
||||||
@Min(value = 1L, message = "项目明细ID ID不能小于1")
|
|
||||||
@Schema(description = "项目明细ID", example = "1")
|
|
||||||
private Long projectDetailId;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 我的单价
|
|
||||||
*/
|
|
||||||
@Schema(description = "我的单价", example = "0.24")
|
|
||||||
private BigDecimal myUnitPrice;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 当前抽佣比例
|
* 当前抽佣比例
|
||||||
*/
|
*/
|
||||||
@Schema(description = "当前抽佣比例", example = "4")
|
@Schema(description = "当前抽佣比例", example = "4")
|
||||||
private BigDecimal currentCommissionRate;
|
private BigDecimal currentCommissionRate;
|
||||||
|
|
||||||
/**
|
|
||||||
* 下级用户ID
|
|
||||||
*/
|
|
||||||
@Min(value = 1L, message = "下级用户ID ID不能小于1")
|
|
||||||
@Schema(description = "下级用户ID", example = "2")
|
|
||||||
private Long subUserId;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 项目ID
|
|
||||||
*/
|
|
||||||
@Min(value = 1L, message = "项目ID ID不能小于1")
|
|
||||||
@Schema(description = "项目ID", example = "1")
|
|
||||||
private Long projectId;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 用户ID
|
|
||||||
*/
|
|
||||||
@Min(value = 1L, message = "用户ID ID不能小于1")
|
|
||||||
@Schema(description = "用户ID", example = "1")
|
|
||||||
private Long userId;
|
|
||||||
|
|
||||||
|
|
||||||
@Serial
|
@Serial
|
||||||
private static final long serialVersionUID = 1L;
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
|
@ -1,14 +1,11 @@
|
||||||
package com.greenorange.promotion.model.dto.user;
|
package com.greenorange.promotion.model.dto.userInfo;
|
||||||
|
|
||||||
import com.greenorange.promotion.annotation.UserEnumValue;
|
import com.greenorange.promotion.annotation.UserEnumValue;
|
||||||
import com.greenorange.promotion.model.enums.UserRoleEnum;
|
import com.greenorange.promotion.model.enums.UserRoleEnum;
|
||||||
import io.swagger.v3.oas.annotations.media.Schema;
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
import jakarta.validation.constraints.NotBlank;
|
import jakarta.validation.constraints.NotBlank;
|
||||||
import jakarta.validation.constraints.Size;
|
import jakarta.validation.constraints.Size;
|
||||||
import lombok.AllArgsConstructor;
|
|
||||||
import lombok.Builder;
|
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
import lombok.NoArgsConstructor;
|
|
||||||
|
|
||||||
import java.io.Serial;
|
import java.io.Serial;
|
||||||
import java.io.Serializable;
|
import java.io.Serializable;
|
|
@ -1,4 +1,4 @@
|
||||||
package com.greenorange.promotion.model.dto.user;
|
package com.greenorange.promotion.model.dto.userInfo;
|
||||||
|
|
||||||
import io.swagger.v3.oas.annotations.media.Schema;
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
import jakarta.validation.constraints.NotBlank;
|
import jakarta.validation.constraints.NotBlank;
|
|
@ -1,4 +1,4 @@
|
||||||
package com.greenorange.promotion.model.dto.user;
|
package com.greenorange.promotion.model.dto.userInfo;
|
||||||
|
|
||||||
import io.swagger.v3.oas.annotations.media.Schema;
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
import jakarta.validation.constraints.NotBlank;
|
import jakarta.validation.constraints.NotBlank;
|
|
@ -1,4 +1,4 @@
|
||||||
package com.greenorange.promotion.model.dto.user;
|
package com.greenorange.promotion.model.dto.userInfo;
|
||||||
|
|
||||||
import io.swagger.v3.oas.annotations.media.Schema;
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
import jakarta.validation.constraints.NotBlank;
|
import jakarta.validation.constraints.NotBlank;
|
|
@ -1,9 +1,7 @@
|
||||||
package com.greenorange.promotion.model.dto.user;
|
package com.greenorange.promotion.model.dto.userInfo;
|
||||||
|
|
||||||
import io.swagger.v3.oas.annotations.media.Schema;
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
import jakarta.validation.constraints.Min;
|
import jakarta.validation.constraints.Min;
|
||||||
import jakarta.validation.constraints.NotBlank;
|
|
||||||
import jakarta.validation.constraints.NotNull;
|
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
import java.io.Serial;
|
import java.io.Serial;
|
||||||
import java.io.Serializable;
|
import java.io.Serializable;
|
|
@ -1,4 +1,4 @@
|
||||||
package com.greenorange.promotion.model.dto.user;
|
package com.greenorange.promotion.model.dto.userInfo;
|
||||||
|
|
||||||
import io.swagger.v3.oas.annotations.media.Schema;
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
import jakarta.validation.constraints.NotBlank;
|
import jakarta.validation.constraints.NotBlank;
|
|
@ -1,4 +1,4 @@
|
||||||
package com.greenorange.promotion.model.dto.user;
|
package com.greenorange.promotion.model.dto.userInfo;
|
||||||
|
|
||||||
import io.swagger.v3.oas.annotations.media.Schema;
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
import jakarta.validation.constraints.NotBlank;
|
import jakarta.validation.constraints.NotBlank;
|
|
@ -1,4 +1,4 @@
|
||||||
package com.greenorange.promotion.model.dto.user;
|
package com.greenorange.promotion.model.dto.userInfo;
|
||||||
|
|
||||||
import com.greenorange.promotion.annotation.UserEnumValue;
|
import com.greenorange.promotion.annotation.UserEnumValue;
|
||||||
import com.greenorange.promotion.model.enums.UserRoleEnum;
|
import com.greenorange.promotion.model.enums.UserRoleEnum;
|
|
@ -40,6 +40,12 @@ public class ProjectDetailCommissionVO implements Serializable {
|
||||||
@Schema(description = "当前抽佣比例", example = "3")
|
@Schema(description = "当前抽佣比例", example = "3")
|
||||||
private BigDecimal currentCommissionRate;
|
private BigDecimal currentCommissionRate;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 最大抽佣比例
|
||||||
|
*/
|
||||||
|
@Schema(description = "最大抽佣比例", example = "2")
|
||||||
|
private BigDecimal maxCommissionRate;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 项目id
|
* 项目id
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -1,60 +1,43 @@
|
||||||
package com.greenorange.promotion.model.vo.subUserProjectCommission;
|
package com.greenorange.promotion.model.vo.subUserProjectCommission;
|
||||||
|
|
||||||
import io.swagger.v3.oas.annotations.media.Schema;
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Builder;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
import java.io.Serial;
|
import java.io.Serial;
|
||||||
import java.io.Serializable;
|
import java.io.Serializable;
|
||||||
import java.math.BigDecimal;
|
import java.math.BigDecimal;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 下级用户项目明细抽佣 视图对象
|
* 下级用户项目明细抽佣 视图对象
|
||||||
*/
|
*/
|
||||||
@Data
|
@Data
|
||||||
@Schema(description = "下级用户项目明细抽佣 视图对象")
|
@Schema(description = "下级用户项目明细抽佣 视图对象")
|
||||||
|
@NoArgsConstructor
|
||||||
|
@AllArgsConstructor
|
||||||
|
@Builder
|
||||||
public class SubUserProjectCommissionVO implements Serializable {
|
public class SubUserProjectCommissionVO implements Serializable {
|
||||||
|
|
||||||
/**
|
|
||||||
* 下级用户项目明细抽佣ID
|
|
||||||
*/
|
|
||||||
@Schema(description = "下级用户项目明细抽佣ID", example = "1")
|
|
||||||
private Long id;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 项目明细ID
|
|
||||||
*/
|
|
||||||
@Schema(description = "项目明细ID", example = "${field.example}")
|
|
||||||
private Long projectDetailId;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 我的单价
|
|
||||||
*/
|
|
||||||
@Schema(description = "我的单价", example = "${field.example}")
|
|
||||||
private BigDecimal myUnitPrice;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 当前抽佣比例
|
|
||||||
*/
|
|
||||||
@Schema(description = "当前抽佣比例", example = "${field.example}")
|
|
||||||
private BigDecimal currentCommissionRate;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 下级用户ID
|
* 下级用户ID
|
||||||
*/
|
*/
|
||||||
@Schema(description = "下级用户ID", example = "${field.example}")
|
@Schema(description = "下级用户ID", example = "5")
|
||||||
private Long subUserId;
|
private Long subUserId;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 项目ID
|
* 下级用户昵称
|
||||||
*/
|
*/
|
||||||
@Schema(description = "项目ID", example = "${field.example}")
|
@Schema(description = "下级用户昵称", example = "caozhe")
|
||||||
private Long projectId;
|
private String subUserNickName;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 用户ID
|
* 下级用户的项目明细抽佣列表
|
||||||
*/
|
*/
|
||||||
@Schema(description = "用户ID", example = "${field.example}")
|
@Schema(description = "下级用户项目明细抽佣列表")
|
||||||
private Long userId;
|
private List<SubUserProjectDetailCommissionVO> subUserProjectDetailCommissionVOList;
|
||||||
|
|
||||||
|
|
||||||
@Serial
|
@Serial
|
||||||
|
|
|
@ -0,0 +1,63 @@
|
||||||
|
package com.greenorange.promotion.model.vo.subUserProjectCommission;
|
||||||
|
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.io.Serial;
|
||||||
|
import java.io.Serializable;
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
public class SubUserProjectDetailCommissionVO implements Serializable {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 项目明细抽佣ID
|
||||||
|
*/
|
||||||
|
@Schema(description = "项目明细抽佣ID", example = "1")
|
||||||
|
private Long id;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 项目明细名称
|
||||||
|
*/
|
||||||
|
@Schema(description = "项目明细名称", example = "2.9元购买30元券包")
|
||||||
|
private String projectDetailName;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 我的单价
|
||||||
|
*/
|
||||||
|
@Schema(description = "我的单价", example = "10.44")
|
||||||
|
private BigDecimal myUnitPrice;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 代理单价
|
||||||
|
*/
|
||||||
|
@Schema(description = "代理单价", example = "9.44")
|
||||||
|
private BigDecimal agentUnitPrice;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 当前抽佣比例
|
||||||
|
*/
|
||||||
|
@Schema(description = "当前抽佣比例", example = "3")
|
||||||
|
private BigDecimal currentCommissionRate;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 最大抽佣比例
|
||||||
|
*/
|
||||||
|
@Schema(description = "最大抽佣比例", example = "2")
|
||||||
|
private BigDecimal maxCommissionRate;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 项目id
|
||||||
|
*/
|
||||||
|
@Schema(description = "项目id", example = "1")
|
||||||
|
private Long projectId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 下级用户ID
|
||||||
|
*/
|
||||||
|
@Schema(description = "下级用户ID", example = "5")
|
||||||
|
private Long subUserId;
|
||||||
|
|
||||||
|
@Serial
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
}
|
|
@ -1,8 +1,6 @@
|
||||||
package com.greenorange.promotion.model.vo.user;
|
package com.greenorange.promotion.model.vo.userInfo;
|
||||||
|
|
||||||
import io.swagger.v3.oas.annotations.media.Schema;
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
import jakarta.validation.constraints.NotBlank;
|
|
||||||
import jakarta.validation.constraints.Size;
|
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
|
||||||
import java.io.Serial;
|
import java.io.Serial;
|
|
@ -0,0 +1,67 @@
|
||||||
|
package com.greenorange.promotion.model.vo.userMainInfo;
|
||||||
|
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.io.Serial;
|
||||||
|
import java.io.Serializable;
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
@Schema(description = "用户团队信息 视图对象")
|
||||||
|
public class UserTeamInfoVO implements Serializable {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 用户主要信息ID
|
||||||
|
*/
|
||||||
|
@Schema(description = "用户主要信息ID", example = "1")
|
||||||
|
private Long id;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 团队人数(不包括自己)
|
||||||
|
*/
|
||||||
|
@Schema(description = "团队人数(不包括自己)", example = "${field.example}")
|
||||||
|
private Integer teamSize;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 给上级带来的收益
|
||||||
|
*/
|
||||||
|
@Schema(description = "给上级带来的收益", example = "${field.example}")
|
||||||
|
private BigDecimal parentEarnings;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 当前余额
|
||||||
|
*/
|
||||||
|
@Schema(description = "当前余额", example = "${field.example}")
|
||||||
|
private BigDecimal currentBalance;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 提现中的金额
|
||||||
|
*/
|
||||||
|
@Schema(description = "提现中的金额", example = "${field.example}")
|
||||||
|
private BigDecimal withdrawalAmount;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 已提现的金额
|
||||||
|
*/
|
||||||
|
@Schema(description = "已提现的金额", example = "${field.example}")
|
||||||
|
private BigDecimal withdrawnAmount;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 累计收入
|
||||||
|
*/
|
||||||
|
@Schema(description = "累计收入", example = "${field.example}")
|
||||||
|
private BigDecimal totalIncome;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 邀请二维码
|
||||||
|
*/
|
||||||
|
@Schema(description = "邀请二维码", example = "${field.example}")
|
||||||
|
private String inviteQrCode;
|
||||||
|
|
||||||
|
|
||||||
|
@Serial
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
}
|
|
@ -1,10 +1,9 @@
|
||||||
package com.greenorange.promotion.service.user;
|
package com.greenorange.promotion.service.userInfo;
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||||
import com.greenorange.promotion.model.dto.user.*;
|
import com.greenorange.promotion.model.dto.userInfo.*;
|
||||||
import com.greenorange.promotion.model.entity.UserInfo;
|
import com.greenorange.promotion.model.entity.UserInfo;
|
||||||
import com.baomidou.mybatisplus.extension.service.IService;
|
import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
import jakarta.servlet.http.HttpServletRequest;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author 35880
|
* @author 35880
|
|
@ -1,4 +1,4 @@
|
||||||
package com.greenorange.promotion.service.user;
|
package com.greenorange.promotion.service.userInfo;
|
||||||
|
|
||||||
import com.greenorange.promotion.model.entity.UserMainInfo;
|
import com.greenorange.promotion.model.entity.UserMainInfo;
|
||||||
import com.baomidou.mybatisplus.extension.service.IService;
|
import com.baomidou.mybatisplus.extension.service.IService;
|
|
@ -1,10 +1,9 @@
|
||||||
package com.greenorange.promotion.service.user.impl;
|
package com.greenorange.promotion.service.userInfo.impl;
|
||||||
|
|
||||||
import cn.hutool.core.util.RandomUtil;
|
import cn.hutool.core.util.RandomUtil;
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||||
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
||||||
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
|
|
||||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
import com.greenorange.promotion.common.ErrorCode;
|
import com.greenorange.promotion.common.ErrorCode;
|
||||||
import com.greenorange.promotion.constant.CommonConstant;
|
import com.greenorange.promotion.constant.CommonConstant;
|
||||||
|
@ -12,13 +11,13 @@ import com.greenorange.promotion.constant.SystemConstant;
|
||||||
import com.greenorange.promotion.constant.UserConstant;
|
import com.greenorange.promotion.constant.UserConstant;
|
||||||
import com.greenorange.promotion.exception.ThrowUtils;
|
import com.greenorange.promotion.exception.ThrowUtils;
|
||||||
import com.greenorange.promotion.mapper.UserInfoMapper;
|
import com.greenorange.promotion.mapper.UserInfoMapper;
|
||||||
import com.greenorange.promotion.model.dto.user.*;
|
import com.greenorange.promotion.model.dto.userInfo.*;
|
||||||
import com.greenorange.promotion.model.entity.UserInfo;
|
import com.greenorange.promotion.model.entity.UserInfo;
|
||||||
import com.greenorange.promotion.model.entity.UserMainInfo;
|
import com.greenorange.promotion.model.entity.UserMainInfo;
|
||||||
import com.greenorange.promotion.model.enums.UserRoleEnum;
|
import com.greenorange.promotion.model.enums.UserRoleEnum;
|
||||||
import com.greenorange.promotion.service.common.CommonService;
|
import com.greenorange.promotion.service.common.CommonService;
|
||||||
import com.greenorange.promotion.service.user.UserInfoService;
|
import com.greenorange.promotion.service.userInfo.UserInfoService;
|
||||||
import com.greenorange.promotion.service.user.UserMainInfoService;
|
import com.greenorange.promotion.service.userInfo.UserMainInfoService;
|
||||||
import com.greenorange.promotion.service.wechat.WechatGetQrcodeService;
|
import com.greenorange.promotion.service.wechat.WechatGetQrcodeService;
|
||||||
import com.greenorange.promotion.utils.JWTUtils;
|
import com.greenorange.promotion.utils.JWTUtils;
|
||||||
import com.greenorange.promotion.utils.RegexUtils;
|
import com.greenorange.promotion.utils.RegexUtils;
|
||||||
|
@ -26,7 +25,6 @@ import com.greenorange.promotion.utils.SendSmsUtil;
|
||||||
import com.greenorange.promotion.utils.SqlUtils;
|
import com.greenorange.promotion.utils.SqlUtils;
|
||||||
import jakarta.annotation.Resource;
|
import jakarta.annotation.Resource;
|
||||||
import org.apache.commons.lang3.StringUtils;
|
import org.apache.commons.lang3.StringUtils;
|
||||||
import org.springframework.beans.BeanUtils;
|
|
||||||
import org.springframework.data.redis.core.RedisTemplate;
|
import org.springframework.data.redis.core.RedisTemplate;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
package com.greenorange.promotion.service.user.impl;
|
package com.greenorange.promotion.service.userInfo.impl;
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
import com.greenorange.promotion.model.entity.UserMainInfo;
|
import com.greenorange.promotion.model.entity.UserMainInfo;
|
||||||
import com.greenorange.promotion.service.user.UserMainInfoService;
|
import com.greenorange.promotion.service.userInfo.UserMainInfoService;
|
||||||
import com.greenorange.promotion.mapper.UserMainInfoMapper;
|
import com.greenorange.promotion.mapper.UserMainInfoMapper;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
Loading…
Reference in New Issue
Block a user