Compare commits
27 Commits
Author | SHA1 | Date | |
---|---|---|---|
78403af455 | |||
f51d42230c | |||
5c6b502c1e | |||
e880431e07 | |||
1513ea51dc | |||
bbd063c4cd | |||
42aff09dae | |||
77c73355e2 | |||
3d8fd5591e | |||
ad6eb74170 | |||
1f7e1211cf | |||
502f079194 | |||
a0e60bece6 | |||
f871d61650 | |||
95d30cc5f6 | |||
7ca23bc987 | |||
746ac2c6bd | |||
5ec4c4ff42 | |||
2c25017f0a | |||
c04ae851cd | |||
5b56f29e45 | |||
7140d5008f | |||
460dced912 | |||
d18d87f81d | |||
2827ef39c5 | |||
ddad249dea | |||
8ad84afcfe |
14
pom.xml
14
pom.xml
@ -207,6 +207,20 @@
|
|||||||
<version>2.6</version>
|
<version>2.6</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
|
<!--图片合成-->
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.freewayso</groupId>
|
||||||
|
<artifactId>image-combiner</artifactId>
|
||||||
|
<version>2.6.9</version>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.springframework.security</groupId>
|
||||||
|
<artifactId>spring-security-crypto</artifactId>
|
||||||
|
<version>5.8.7</version> <!-- 换成你项目里使用的 Spring Security 版本 -->
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -0,0 +1,10 @@
|
|||||||
|
package com.greenorange.promotion.annotation;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 所有待校验的枚举都应实现此接口,
|
||||||
|
* 并通过 getValue() 返回其对应的校验字符串。
|
||||||
|
*/
|
||||||
|
public interface BaseEnum {
|
||||||
|
/** 返回该枚举常量对应的校验值 */
|
||||||
|
String getValue();
|
||||||
|
}
|
@ -0,0 +1,18 @@
|
|||||||
|
package com.greenorange.promotion.annotation;
|
||||||
|
|
||||||
|
import jakarta.validation.Constraint;
|
||||||
|
import jakarta.validation.Payload;
|
||||||
|
import java.lang.annotation.*;
|
||||||
|
|
||||||
|
@Documented
|
||||||
|
@Constraint(validatedBy = EnumValueValidator.class)
|
||||||
|
@Target({ ElementType.FIELD, ElementType.PARAMETER, ElementType.METHOD })
|
||||||
|
@Retention(RetentionPolicy.RUNTIME)
|
||||||
|
public @interface EnumValue {
|
||||||
|
String message() default "无效的枚举值";
|
||||||
|
Class<?>[] groups() default {};
|
||||||
|
Class<? extends Payload>[] payload() default {};
|
||||||
|
|
||||||
|
/** 要校验的枚举类,必须实现 BaseEnum */
|
||||||
|
Class<? extends BaseEnum> enumClass();
|
||||||
|
}
|
@ -0,0 +1,30 @@
|
|||||||
|
package com.greenorange.promotion.annotation;
|
||||||
|
|
||||||
|
import jakarta.validation.ConstraintValidator;
|
||||||
|
import jakarta.validation.ConstraintValidatorContext;
|
||||||
|
import org.apache.commons.lang3.StringUtils;
|
||||||
|
|
||||||
|
import java.util.Set;
|
||||||
|
import java.util.stream.Collectors;
|
||||||
|
import java.util.stream.Stream;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 初始化时从 enumClass 拿到所有常量的 getValue(),
|
||||||
|
* 然后在 isValid 中判断传入值是否包含于其中。
|
||||||
|
*/
|
||||||
|
public class EnumValueValidator implements ConstraintValidator<EnumValue, String> {
|
||||||
|
private Set<String> validValues;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void initialize(EnumValue annotation) {
|
||||||
|
Class<? extends BaseEnum> enumClass = annotation.enumClass();
|
||||||
|
validValues = Stream.of(enumClass.getEnumConstants())
|
||||||
|
.map(BaseEnum::getValue)
|
||||||
|
.collect(Collectors.toSet());
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean isValid(String value, ConstraintValidatorContext context) {
|
||||||
|
return StringUtils.isBlank(value) || validValues.contains(value);
|
||||||
|
}
|
||||||
|
}
|
@ -1,20 +0,0 @@
|
|||||||
package com.greenorange.promotion.annotation;
|
|
||||||
|
|
||||||
import com.greenorange.promotion.model.enums.FileUploadBizEnum;
|
|
||||||
import jakarta.validation.ConstraintValidator;
|
|
||||||
import jakarta.validation.ConstraintValidatorContext;
|
|
||||||
|
|
||||||
// 枚举校验器
|
|
||||||
public class FileEnumValidator implements ConstraintValidator<FileEnumValue, String> {
|
|
||||||
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void initialize(FileEnumValue constraintAnnotation) {
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean isValid(String value, ConstraintValidatorContext context) {
|
|
||||||
return FileUploadBizEnum.getEnumByValue(value) != null;
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,20 +0,0 @@
|
|||||||
package com.greenorange.promotion.annotation;
|
|
||||||
|
|
||||||
import jakarta.validation.Constraint;
|
|
||||||
import jakarta.validation.Payload;
|
|
||||||
|
|
||||||
import java.lang.annotation.ElementType;
|
|
||||||
import java.lang.annotation.Retention;
|
|
||||||
import java.lang.annotation.RetentionPolicy;
|
|
||||||
import java.lang.annotation.Target;
|
|
||||||
|
|
||||||
// 自定义校验注解
|
|
||||||
@Constraint(validatedBy = FileEnumValidator.class)
|
|
||||||
@Target({ ElementType.FIELD, ElementType.PARAMETER, ElementType.METHOD })
|
|
||||||
@Retention(RetentionPolicy.RUNTIME)
|
|
||||||
public @interface FileEnumValue {
|
|
||||||
String message() default "文件业务类型错误"; // 错误信息
|
|
||||||
Class<?>[] groups() default {}; // 组别
|
|
||||||
Class<? extends Payload>[] payload() default {}; // 负载
|
|
||||||
Class<? extends Enum<?>> enumClass(); // 枚举类类型
|
|
||||||
}
|
|
@ -1,18 +0,0 @@
|
|||||||
package com.greenorange.promotion.annotation;
|
|
||||||
|
|
||||||
import com.greenorange.promotion.model.enums.ProjectStatusEnum;
|
|
||||||
import jakarta.validation.ConstraintValidator;
|
|
||||||
import jakarta.validation.ConstraintValidatorContext;
|
|
||||||
|
|
||||||
public class ProjectStatusEnumValidator implements ConstraintValidator<ProjectStatusEnumValue, String> {
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void initialize(ProjectStatusEnumValue constraintAnnotation) {
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean isValid(String value, ConstraintValidatorContext context) {
|
|
||||||
return ProjectStatusEnum.getEnumByValue(value) != null;
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,22 +0,0 @@
|
|||||||
package com.greenorange.promotion.annotation;
|
|
||||||
|
|
||||||
import jakarta.validation.Constraint;
|
|
||||||
import jakarta.validation.Payload;
|
|
||||||
|
|
||||||
import java.lang.annotation.ElementType;
|
|
||||||
import java.lang.annotation.Retention;
|
|
||||||
import java.lang.annotation.RetentionPolicy;
|
|
||||||
import java.lang.annotation.Target;
|
|
||||||
|
|
||||||
// 自定义校验注解
|
|
||||||
@Constraint(validatedBy = ProjectStatusEnumValidator.class)
|
|
||||||
@Target({ ElementType.FIELD, ElementType.PARAMETER, ElementType.METHOD })
|
|
||||||
@Retention(RetentionPolicy.RUNTIME)
|
|
||||||
public @interface ProjectStatusEnumValue {
|
|
||||||
|
|
||||||
String message() default "项目状态错误"; // 错误信息
|
|
||||||
Class<?>[] groups() default {}; // 组别
|
|
||||||
Class<? extends Payload>[] payload() default {}; // 负载
|
|
||||||
Class<? extends Enum<?>> enumClass(); // 枚举类类型
|
|
||||||
|
|
||||||
}
|
|
@ -1,22 +0,0 @@
|
|||||||
package com.greenorange.promotion.annotation;
|
|
||||||
|
|
||||||
|
|
||||||
import com.greenorange.promotion.model.enums.UserRoleEnum;
|
|
||||||
import jakarta.validation.ConstraintValidator;
|
|
||||||
import jakarta.validation.ConstraintValidatorContext;
|
|
||||||
|
|
||||||
|
|
||||||
// 枚举校验器
|
|
||||||
public class UserEnumValidator implements ConstraintValidator<UserEnumValue, String> {
|
|
||||||
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void initialize(UserEnumValue constraintAnnotation) {
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean isValid(String value, ConstraintValidatorContext context) {
|
|
||||||
return UserRoleEnum.getEnumByValue(value) != null;
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,20 +0,0 @@
|
|||||||
package com.greenorange.promotion.annotation;
|
|
||||||
|
|
||||||
import jakarta.validation.Constraint;
|
|
||||||
import jakarta.validation.Payload;
|
|
||||||
|
|
||||||
import java.lang.annotation.ElementType;
|
|
||||||
import java.lang.annotation.Retention;
|
|
||||||
import java.lang.annotation.RetentionPolicy;
|
|
||||||
import java.lang.annotation.Target;
|
|
||||||
|
|
||||||
// 自定义校验注解
|
|
||||||
@Constraint(validatedBy = UserEnumValidator.class)
|
|
||||||
@Target({ ElementType.FIELD, ElementType.PARAMETER, ElementType.METHOD })
|
|
||||||
@Retention(RetentionPolicy.RUNTIME)
|
|
||||||
public @interface UserEnumValue {
|
|
||||||
String message() default "无效的用户角色"; // 错误信息
|
|
||||||
Class<?>[] groups() default {}; // 组别
|
|
||||||
Class<? extends Payload>[] payload() default {}; // 负载
|
|
||||||
Class<? extends Enum<?>> enumClass(); // 枚举类类型
|
|
||||||
}
|
|
@ -1,18 +0,0 @@
|
|||||||
package com.greenorange.promotion.annotation;
|
|
||||||
|
|
||||||
import com.greenorange.promotion.model.enums.WithdrawStatusEnum;
|
|
||||||
import jakarta.validation.ConstraintValidator;
|
|
||||||
import jakarta.validation.ConstraintValidatorContext;
|
|
||||||
|
|
||||||
public class WithdrawStatusEnumValidator implements ConstraintValidator<WithdrawStatusEnumValue, String> {
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void initialize(WithdrawStatusEnumValue constraintAnnotation) {
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean isValid(String value, ConstraintValidatorContext context) {
|
|
||||||
return WithdrawStatusEnum.getEnumByValue(value) != null;
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,21 +0,0 @@
|
|||||||
package com.greenorange.promotion.annotation;
|
|
||||||
|
|
||||||
import jakarta.validation.Constraint;
|
|
||||||
import jakarta.validation.Payload;
|
|
||||||
|
|
||||||
import java.lang.annotation.ElementType;
|
|
||||||
import java.lang.annotation.Retention;
|
|
||||||
import java.lang.annotation.RetentionPolicy;
|
|
||||||
import java.lang.annotation.Target;
|
|
||||||
|
|
||||||
|
|
||||||
// 自定义校验注解
|
|
||||||
@Constraint(validatedBy = WithdrawStatusEnumValidator.class)
|
|
||||||
@Target({ ElementType.FIELD, ElementType.PARAMETER, ElementType.METHOD })
|
|
||||||
@Retention(RetentionPolicy.RUNTIME)
|
|
||||||
public @interface WithdrawStatusEnumValue {
|
|
||||||
String message() default "提现状态错误"; // 错误信息
|
|
||||||
Class<?>[] groups() default {}; // 组别
|
|
||||||
Class<? extends Payload>[] payload() default {}; // 负载
|
|
||||||
Class<? extends Enum<?>> enumClass(); // 枚举类类型
|
|
||||||
}
|
|
@ -4,7 +4,7 @@ import lombok.Getter;
|
|||||||
|
|
||||||
@Getter
|
@Getter
|
||||||
public enum ErrorCode {
|
public enum ErrorCode {
|
||||||
|
// private static final SUCESS = new ErrorCode(1, "ok");
|
||||||
SUCCESS(1,"ok"),
|
SUCCESS(1,"ok"),
|
||||||
PARAMS_ERROR(40000,"请求参数错误"),
|
PARAMS_ERROR(40000,"请求参数错误"),
|
||||||
NOT_LOGIN_ERROR(40100,"未登录"),
|
NOT_LOGIN_ERROR(40100,"未登录"),
|
||||||
|
@ -0,0 +1,17 @@
|
|||||||
|
package com.greenorange.promotion.constant;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 订单状态常量
|
||||||
|
*/
|
||||||
|
public interface OrderStatusConstant {
|
||||||
|
|
||||||
|
String CLOSED = "交易关闭";
|
||||||
|
|
||||||
|
String SUCCESS = "交易成功";
|
||||||
|
|
||||||
|
String PENDING = "待支付";
|
||||||
|
|
||||||
|
String REFUNDED = "已退款";
|
||||||
|
|
||||||
|
|
||||||
|
}
|
@ -2,8 +2,6 @@ package com.greenorange.promotion.constant;
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 正则表达式常量
|
* 正则表达式常量
|
||||||
*
|
|
||||||
* @author <a href="https://xuande-hk.gitee.io">玄德</a>
|
|
||||||
*/
|
*/
|
||||||
@SuppressWarnings("all")
|
@SuppressWarnings("all")
|
||||||
public interface RegexConstant {
|
public interface RegexConstant {
|
||||||
|
@ -7,4 +7,10 @@ public interface SystemConstant {
|
|||||||
*/
|
*/
|
||||||
String VERIFICATION_CODE = "verificationCode";
|
String VERIFICATION_CODE = "verificationCode";
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 文件公共前缀
|
||||||
|
*/
|
||||||
|
String FILE_COMMON_PREFIX = "http://27.30.77.229:9091/file/download/";
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -0,0 +1,145 @@
|
|||||||
|
package com.greenorange.promotion.controller.course;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||||
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
|
import com.greenorange.promotion.annotation.RequiresPermission;
|
||||||
|
import com.greenorange.promotion.annotation.SysLog;
|
||||||
|
import com.greenorange.promotion.common.BaseResponse;
|
||||||
|
import com.greenorange.promotion.common.ResultUtils;
|
||||||
|
import com.greenorange.promotion.constant.UserConstant;
|
||||||
|
import com.greenorange.promotion.model.dto.CommonBatchRequest;
|
||||||
|
import com.greenorange.promotion.model.dto.CommonRequest;
|
||||||
|
import com.greenorange.promotion.model.dto.courseChapter.CourseChapterAddRequest;
|
||||||
|
import com.greenorange.promotion.model.dto.courseChapter.CourseChapterQueryRequest;
|
||||||
|
import com.greenorange.promotion.model.dto.courseChapter.CourseChapterUpdateRequest;
|
||||||
|
import com.greenorange.promotion.model.entity.CourseChapter;
|
||||||
|
import com.greenorange.promotion.model.vo.courseChapter.CourseChapterVO;
|
||||||
|
import com.greenorange.promotion.service.common.CommonService;
|
||||||
|
import com.greenorange.promotion.service.course.CourseChapterService;
|
||||||
|
import io.swagger.v3.oas.annotations.Operation;
|
||||||
|
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||||
|
import jakarta.annotation.Resource;
|
||||||
|
import jakarta.validation.Valid;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.springframework.web.bind.annotation.PostMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RequestBody;
|
||||||
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 课程章节 控制器
|
||||||
|
*/
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("courseChapter")
|
||||||
|
@Slf4j
|
||||||
|
@Tag(name = "课程章节模块")
|
||||||
|
public class CourseChapterController {
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private CourseChapterService courseChapterService;
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private CommonService commonService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* web端管理员添加课程章节
|
||||||
|
* @param courseChapterAddRequest 课程章节添加请求体
|
||||||
|
* @return 是否添加成功
|
||||||
|
*/
|
||||||
|
@PostMapping("add")
|
||||||
|
@Operation(summary = "web端管理员添加课程章节", description = "参数:课程章节添加请求体,权限:管理员,方法名:addCourseChapter")
|
||||||
|
@RequiresPermission(mustRole = UserConstant.ADMIN_ROLE)
|
||||||
|
@SysLog(title = "课程章节管理", content = "web端管理员添加课程章节")
|
||||||
|
public BaseResponse<Long> addCourseChapter(@Valid @RequestBody CourseChapterAddRequest courseChapterAddRequest) {
|
||||||
|
CourseChapter courseChapter = commonService.copyProperties(courseChapterAddRequest, CourseChapter.class);
|
||||||
|
courseChapterService.save(courseChapter);
|
||||||
|
return ResultUtils.success(courseChapter.getId());
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* web端管理员根据id修改课程章节信息
|
||||||
|
* @param courseChapterUpdateRequest 课程章节更新请求体
|
||||||
|
* @return 是否更新成功
|
||||||
|
*/
|
||||||
|
@PostMapping("update")
|
||||||
|
@Operation(summary = "web端管理员根据id修改课程章节", description = "参数:课程章节更新请求体,权限:管理员,方法名:updateCourseChapter")
|
||||||
|
@RequiresPermission(mustRole = UserConstant.ADMIN_ROLE)
|
||||||
|
@SysLog(title = "课程章节管理", content = "web端管理员根据id修改课程章节信息")
|
||||||
|
public BaseResponse<Boolean> updateCourseChapter(@Valid @RequestBody CourseChapterUpdateRequest courseChapterUpdateRequest) {
|
||||||
|
CourseChapter courseChapter = commonService.copyProperties(courseChapterUpdateRequest, CourseChapter.class);
|
||||||
|
courseChapterService.updateById(courseChapter);
|
||||||
|
return ResultUtils.success(true);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* web端管理员根据id删除课程章节
|
||||||
|
* @param commonRequest 课程章节删除请求体
|
||||||
|
* @return 是否删除成功
|
||||||
|
*/
|
||||||
|
@PostMapping("delete")
|
||||||
|
@Operation(summary = "web端管理员根据id删除课程章节", description = "参数:课程章节删除请求体,权限:管理员,方法名:delCourseChapter")
|
||||||
|
@RequiresPermission(mustRole = UserConstant.ADMIN_ROLE)
|
||||||
|
@SysLog(title = "课程章节管理", content = "web端管理员根据id删除课程章节")
|
||||||
|
public BaseResponse<Boolean> delCourseChapter(@Valid @RequestBody CommonRequest commonRequest) {
|
||||||
|
Long id = commonRequest.getId();
|
||||||
|
courseChapterService.removeById(id);
|
||||||
|
return ResultUtils.success(true);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* web端管理员批量删除课程章节
|
||||||
|
* @param commonBatchRequest 课程章节批量删除请求体
|
||||||
|
* @return 是否删除成功
|
||||||
|
*/
|
||||||
|
@PostMapping("delBatch")
|
||||||
|
@Operation(summary = "web端管理员批量删除课程章节", description = "参数:课程章节批量删除请求体,权限:管理员,方法名:delBatchCourseChapter")
|
||||||
|
@RequiresPermission(mustRole = UserConstant.ADMIN_ROLE)
|
||||||
|
@SysLog(title = "课程章节管理", content = "web端管理员批量删除课程章节")
|
||||||
|
public BaseResponse<Boolean> delBatchCourseChapter(@Valid @RequestBody CommonBatchRequest commonBatchRequest) {
|
||||||
|
List<Long> ids = commonBatchRequest.getIds();
|
||||||
|
courseChapterService.removeByIds(ids);
|
||||||
|
return ResultUtils.success(true);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* web端管理员根据id查询课程章节
|
||||||
|
* @param commonRequest 课程章节查询请求体
|
||||||
|
* @return 课程章节信息
|
||||||
|
*/
|
||||||
|
@PostMapping("queryById")
|
||||||
|
@Operation(summary = "web端管理员根据id查询课程章节", description = "参数:课程章节查询请求体,权限:管理员,方法名:queryCourseChapterById")
|
||||||
|
@RequiresPermission(mustRole = UserConstant.ADMIN_ROLE)
|
||||||
|
@SysLog(title = "课程章节管理", content = "web端管理员根据id查询课程章节")
|
||||||
|
public BaseResponse<CourseChapterVO> queryCourseChapterById(@Valid @RequestBody CommonRequest commonRequest) {
|
||||||
|
Long id = commonRequest.getId();
|
||||||
|
CourseChapter courseChapter = courseChapterService.getById(id);
|
||||||
|
CourseChapterVO courseChapterVO = commonService.copyProperties(courseChapter, CourseChapterVO.class);
|
||||||
|
return ResultUtils.success(courseChapterVO);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Web端管理员根据课程id分页查询课程章节
|
||||||
|
* @param courseChapterQueryRequest 课程章节查询请求体
|
||||||
|
* @return 课程章节列表
|
||||||
|
*/
|
||||||
|
@PostMapping("page")
|
||||||
|
@Operation(summary = "Web端管理员根据课程id分页查询课程章节", description = "参数:课程章节查询请求体,权限:管理员,方法名:listCourseChapterByPageByCourseId")
|
||||||
|
@RequiresPermission(mustRole = UserConstant.ADMIN_ROLE)
|
||||||
|
@SysLog(title = "课程章节管理", content = "Web端管理员根据课程id分页查询课程章节")
|
||||||
|
public BaseResponse<Page<CourseChapterVO>> listCourseChapterByPageByCourseId(@Valid @RequestBody CourseChapterQueryRequest courseChapterQueryRequest) {
|
||||||
|
long current = courseChapterQueryRequest.getCurrent();
|
||||||
|
long pageSize = courseChapterQueryRequest.getPageSize();
|
||||||
|
QueryWrapper<CourseChapter> queryWrapper = courseChapterService.getQueryWrapper(courseChapterQueryRequest);
|
||||||
|
Page<CourseChapter> page = courseChapterService.page(new Page<>(current, pageSize), queryWrapper);
|
||||||
|
List<CourseChapter> courseChapterList = page.getRecords();
|
||||||
|
List<CourseChapterVO> courseChapterVOList = commonService.convertList(courseChapterList, CourseChapterVO.class);
|
||||||
|
Page<CourseChapterVO> voPage = new Page<>(current, pageSize);
|
||||||
|
voPage.setRecords(courseChapterVOList);
|
||||||
|
voPage.setPages(page.getPages());
|
||||||
|
voPage.setTotal(page.getTotal());
|
||||||
|
return ResultUtils.success(voPage);
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,320 @@
|
|||||||
|
package com.greenorange.promotion.controller.course;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||||
|
import com.baomidou.mybatisplus.core.toolkit.support.SFunction;
|
||||||
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
|
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.BusinessException;
|
||||||
|
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.CommonStringRequest;
|
||||||
|
import com.greenorange.promotion.model.dto.course.CourseAddRequest;
|
||||||
|
import com.greenorange.promotion.model.dto.course.CourseQueryRequest;
|
||||||
|
import com.greenorange.promotion.model.dto.course.CourseUpdateRequest;
|
||||||
|
import com.greenorange.promotion.model.entity.Course;
|
||||||
|
import com.greenorange.promotion.model.entity.CourseChapter;
|
||||||
|
import com.greenorange.promotion.model.entity.CourseQrcodeApply;
|
||||||
|
import com.greenorange.promotion.model.entity.ProjectCommission;
|
||||||
|
import com.greenorange.promotion.model.vo.course.CourseCardVO;
|
||||||
|
import com.greenorange.promotion.model.vo.course.CourseDetailVO;
|
||||||
|
import com.greenorange.promotion.model.vo.course.CourseVO;
|
||||||
|
import com.greenorange.promotion.model.vo.courseChapter.CourseChapterVO;
|
||||||
|
import com.greenorange.promotion.service.common.CommonService;
|
||||||
|
import com.greenorange.promotion.service.course.CourseChapterService;
|
||||||
|
import com.greenorange.promotion.service.course.CourseQrcodeApplyService;
|
||||||
|
import com.greenorange.promotion.service.course.CourseService;
|
||||||
|
import com.greenorange.promotion.service.wechat.WechatGetQrcodeService;
|
||||||
|
import io.swagger.v3.oas.annotations.Operation;
|
||||||
|
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||||
|
import jakarta.annotation.Resource;
|
||||||
|
import jakarta.servlet.http.HttpServletRequest;
|
||||||
|
import jakarta.validation.Valid;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.springframework.web.bind.annotation.PostMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RequestBody;
|
||||||
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
|
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 课程 控制器
|
||||||
|
*/
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("course")
|
||||||
|
@Slf4j
|
||||||
|
@Tag(name = "课程模块")
|
||||||
|
public class CourseController {
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private CourseService courseService;
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private CommonService commonService;
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private CourseChapterService courseChapterService;
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private WechatGetQrcodeService wechatGetQrcodeService;
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private CourseQrcodeApplyService courseQrcodeApplyService;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 小程序端用户查看热门课程列表
|
||||||
|
* @return 课程信息列表
|
||||||
|
*/
|
||||||
|
@PostMapping("query/hot")
|
||||||
|
@Operation(summary = "小程序端用户查看热门课程列表", description = "参数:无,权限:管理员,方法名:miniQueryHotCourseList")
|
||||||
|
@RequiresPermission(mustRole = UserConstant.DEFAULT_ROLE)
|
||||||
|
@SysLog(title = "课程管理", content = "小程序端用户查看热门课程列表")
|
||||||
|
public BaseResponse<List<CourseCardVO>> miniQueryHotCourseList() {
|
||||||
|
List<Course> courseList = commonService.findByFieldEqTargetField(Course::getIsShelves, true, courseService);
|
||||||
|
// 降序排序并取前四个元素
|
||||||
|
courseList = courseList.stream()
|
||||||
|
.sorted((course1, course2) -> Integer.compare(course2.getOrderCount(), course1.getOrderCount())) // 降序排序
|
||||||
|
.limit(4) // 取前四个元素
|
||||||
|
.collect(Collectors.toList());
|
||||||
|
List<CourseCardVO> courseCardVOS = commonService.convertList(courseList, CourseCardVO.class);
|
||||||
|
return ResultUtils.success(courseCardVOS);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 小程序端用户根据类别查看课程列表
|
||||||
|
* @param commonStringRequest 课程类别
|
||||||
|
* @return 课程信息列表
|
||||||
|
*/
|
||||||
|
@PostMapping("query/type")
|
||||||
|
@Operation(summary = "小程序端用户根据类别查看课程列表", description = "参数:课程添加请求体,权限:管理员,方法名:miniQueryCourseByType")
|
||||||
|
@RequiresPermission(mustRole = UserConstant.DEFAULT_ROLE)
|
||||||
|
@SysLog(title = "课程管理", content = "小程序端用户根据类别查看课程列表")
|
||||||
|
public BaseResponse<List<CourseCardVO>> miniQueryCourseByType(@Valid @RequestBody CommonStringRequest commonStringRequest) {
|
||||||
|
String courseType = commonStringRequest.getTemplateString();
|
||||||
|
Map<SFunction<Course, ?>, Object> fieldConditions = Map.of(Course::getType, courseType, Course::getIsShelves, true);
|
||||||
|
List<Course> courseList = commonService.findByFieldEqTargetFields(fieldConditions, courseService);
|
||||||
|
List<CourseCardVO> courseCardVOS = commonService.convertList(courseList, CourseCardVO.class);
|
||||||
|
return ResultUtils.success(courseCardVOS);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 小程序端用户根据id查询课程详情
|
||||||
|
* @param commonRequest 课程id
|
||||||
|
* @return 课程信息列表
|
||||||
|
*/
|
||||||
|
@PostMapping("query/id")
|
||||||
|
@Operation(summary = "小程序端用户根据id查询课程详情", description = "参数:课程id,权限:管理员,方法名:miniQueryCourseById")
|
||||||
|
@SysLog(title = "课程管理", content = "小程序端用户根据id查询课程详情")
|
||||||
|
public BaseResponse<CourseDetailVO> miniQueryCourseById(@Valid @RequestBody CommonRequest commonRequest) {
|
||||||
|
Long id = commonRequest.getId();
|
||||||
|
Course course = courseService.getById(id);
|
||||||
|
CourseDetailVO courseDetailVO = commonService.copyProperties(course, CourseDetailVO.class);
|
||||||
|
LambdaQueryWrapper<CourseChapter> lambdaQueryWrapper = new LambdaQueryWrapper<>();
|
||||||
|
lambdaQueryWrapper.eq(CourseChapter::getCourseId, id);
|
||||||
|
List<CourseChapter> courseChapterList = courseChapterService.list(lambdaQueryWrapper);
|
||||||
|
List<CourseChapterVO> courseChapterVOS = commonService.convertList(courseChapterList, CourseChapterVO.class);
|
||||||
|
courseDetailVO.setCourseChapters(courseChapterVOS);
|
||||||
|
return ResultUtils.success(courseDetailVO);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 小程序端用户生成课程推广码
|
||||||
|
* @param commonRequest 课程id
|
||||||
|
* @return 课程信息列表
|
||||||
|
*/
|
||||||
|
@PostMapping("generate/qrcode")
|
||||||
|
@Operation(summary = "小程序端用户生成课程推广码", description = "参数:课程id,权限:管理员,方法名:miniGenerateQrcode")
|
||||||
|
@RequiresPermission(mustRole = UserConstant.DEFAULT_ROLE)
|
||||||
|
@SysLog(title = "课程管理", content = "小程序端用户生成课程推广码")
|
||||||
|
public BaseResponse<String> miniGenerateQrcode(@Valid @RequestBody CommonRequest commonRequest, HttpServletRequest request) throws Exception {
|
||||||
|
String videoView = wechatGetQrcodeService.getWxCourseQrCode(commonRequest, request);
|
||||||
|
return ResultUtils.success(videoView);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 小程序端用户根据id查看课程基本信息
|
||||||
|
* @param commonRequest 课程id
|
||||||
|
* @return 课程基本信息
|
||||||
|
*/
|
||||||
|
@PostMapping("detail/id")
|
||||||
|
@Operation(summary = "小程序端用户根据id查看课程基本信息", description = "参数:课程id,权限:管理员,方法名:miniQueryCourseBaseInfo")
|
||||||
|
@RequiresPermission(mustRole = UserConstant.DEFAULT_ROLE)
|
||||||
|
@SysLog(title = "课程管理", content = "小程序端用户根据id查看课程基本信息")
|
||||||
|
public BaseResponse<CourseCardVO> miniQueryCourseBaseInfo(@Valid @RequestBody CommonRequest commonRequest) {
|
||||||
|
Long id = commonRequest.getId();
|
||||||
|
Course course = courseService.getById(id);
|
||||||
|
CourseCardVO courseCardVO = commonService.copyProperties(course, CourseCardVO.class);
|
||||||
|
return ResultUtils.success(courseCardVO);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 小程序端用户查看当前课程推广码
|
||||||
|
* @param commonRequest 课程id
|
||||||
|
* @return 课程推广码(view值)
|
||||||
|
*/
|
||||||
|
@PostMapping("verify")
|
||||||
|
@Operation(summary = "小程序端用户查看当前课程推广码", description = "参数:课程id,权限:管理员,方法名:verifyIsApplyCourseQrcode")
|
||||||
|
@RequiresPermission(mustRole = UserConstant.DEFAULT_ROLE)
|
||||||
|
@SysLog(title = "课程管理", content = "小程序端用户查看当前课程推广码")
|
||||||
|
public BaseResponse<String> verifyIsApplyCourseQrcode(@Valid @RequestBody CommonRequest commonRequest, HttpServletRequest request) {
|
||||||
|
Long userId = (Long) request.getAttribute("userId");
|
||||||
|
Long courseId = commonRequest.getId();
|
||||||
|
LambdaQueryWrapper<CourseQrcodeApply> lambdaQueryWrapper = new LambdaQueryWrapper<>();
|
||||||
|
lambdaQueryWrapper.eq(CourseQrcodeApply::getUserId, userId).eq(CourseQrcodeApply::getCourseId, courseId);
|
||||||
|
CourseQrcodeApply courseQrcodeApply = courseQrcodeApplyService.getOne(lambdaQueryWrapper);
|
||||||
|
ThrowUtils.throwIf(courseQrcodeApply == null, ErrorCode.OPERATION_ERROR, "当前用户尚未申请该课程的推广码");
|
||||||
|
return ResultUtils.success(courseQrcodeApply.getCourseQrcode());
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* web端管理员添加课程
|
||||||
|
* @param courseAddRequest 课程添加请求体
|
||||||
|
* @return 是否添加成功
|
||||||
|
*/
|
||||||
|
@PostMapping("add")
|
||||||
|
@Operation(summary = "web端管理员添加课程", description = "参数:课程添加请求体,权限:管理员,方法名:addCourse")
|
||||||
|
@RequiresPermission(mustRole = UserConstant.ADMIN_ROLE)
|
||||||
|
@SysLog(title = "课程管理", content = "web端管理员添加课程")
|
||||||
|
public BaseResponse<Long> addCourse(@Valid @RequestBody CourseAddRequest courseAddRequest) {
|
||||||
|
BigDecimal firstLevelRate = courseAddRequest.getFirstLevelRate();
|
||||||
|
BigDecimal secondLevelRate = courseAddRequest.getSecondLevelRate();
|
||||||
|
ThrowUtils.throwIf(firstLevelRate.compareTo(secondLevelRate) < 0, ErrorCode.PARAMS_ERROR, "一级佣金比例不能小于二级佣金比例");
|
||||||
|
Course course = commonService.copyProperties(courseAddRequest, Course.class);
|
||||||
|
courseService.save(course);
|
||||||
|
return ResultUtils.success(course.getId());
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* web端管理员根据id修改课程信息
|
||||||
|
* @param courseUpdateRequest 课程更新请求体
|
||||||
|
* @return 是否更新成功
|
||||||
|
*/
|
||||||
|
@PostMapping("update")
|
||||||
|
@Operation(summary = "web端管理员根据id修改课程信息", description = "参数:课程更新请求体,权限:管理员,方法名:updateCourse")
|
||||||
|
@RequiresPermission(mustRole = UserConstant.ADMIN_ROLE)
|
||||||
|
@SysLog(title = "课程管理", content = "web端管理员根据id修改课程信息")
|
||||||
|
public BaseResponse<Boolean> updateCourse(@Valid @RequestBody CourseUpdateRequest courseUpdateRequest) {
|
||||||
|
Course course = commonService.copyProperties(courseUpdateRequest, Course.class);
|
||||||
|
courseService.updateById(course);
|
||||||
|
return ResultUtils.success(true);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* web端管理员根据id删除课程
|
||||||
|
* @param commonRequest 课程删除请求体
|
||||||
|
* @return 是否删除成功
|
||||||
|
*/
|
||||||
|
@PostMapping("delete")
|
||||||
|
@Operation(summary = "web端管理员根据id删除课程", description = "参数:课程删除请求体,权限:管理员,方法名:delCourse")
|
||||||
|
@RequiresPermission(mustRole = UserConstant.ADMIN_ROLE)
|
||||||
|
@SysLog(title = "课程管理", content = "web端管理员根据id删除课程")
|
||||||
|
public BaseResponse<Boolean> delCourse(@Valid @RequestBody CommonRequest commonRequest) {
|
||||||
|
Long id = commonRequest.getId();
|
||||||
|
courseService.removeById(id);
|
||||||
|
// 删除课程下的所有章节
|
||||||
|
LambdaQueryWrapper<CourseChapter> lambdaQueryWrapper = commonService.buildQueryWrapperByField(CourseChapter::getCourseId, id, courseChapterService);
|
||||||
|
courseChapterService.remove(lambdaQueryWrapper);
|
||||||
|
return ResultUtils.success(true);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* web端管理员批量删除课程
|
||||||
|
* @param commonBatchRequest 课程批量删除请求体
|
||||||
|
* @return 是否删除成功
|
||||||
|
*/
|
||||||
|
@PostMapping("delBatch")
|
||||||
|
@Operation(summary = "web端管理员批量删除课程", description = "参数:课程批量删除请求体,权限:管理员,方法名:delBatchCourse")
|
||||||
|
@RequiresPermission(mustRole = UserConstant.ADMIN_ROLE)
|
||||||
|
@SysLog(title = "课程管理", content = "web端管理员批量删除课程")
|
||||||
|
public BaseResponse<Boolean> delBatchCourse(@Valid @RequestBody CommonBatchRequest commonBatchRequest) {
|
||||||
|
List<Long> ids = commonBatchRequest.getIds();
|
||||||
|
courseService.removeByIds(ids);
|
||||||
|
// 批量删除课程下的所有章节
|
||||||
|
LambdaQueryWrapper<CourseChapter> lambdaQueryWrapper = new LambdaQueryWrapper<>();
|
||||||
|
lambdaQueryWrapper.in(CourseChapter::getCourseId, ids);
|
||||||
|
courseChapterService.remove(lambdaQueryWrapper);
|
||||||
|
return ResultUtils.success(true);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* web端管理员根据id查询课程
|
||||||
|
* @param commonRequest 课程查询请求体
|
||||||
|
* @return 课程信息
|
||||||
|
*/
|
||||||
|
@PostMapping("queryById")
|
||||||
|
@Operation(summary = "web端管理员根据id查询课程", description = "参数:课程查询请求体,权限:管理员,方法名:queryCourseById")
|
||||||
|
@RequiresPermission(mustRole = UserConstant.ADMIN_ROLE)
|
||||||
|
@SysLog(title = "课程管理", content = "web端管理员根据id查询课程")
|
||||||
|
public BaseResponse<CourseVO> queryCourseById(@Valid @RequestBody CommonRequest commonRequest) {
|
||||||
|
Long id = commonRequest.getId();
|
||||||
|
Course course = courseService.getById(id);
|
||||||
|
CourseVO courseVO = commonService.copyProperties(course, CourseVO.class);
|
||||||
|
return ResultUtils.success(courseVO);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* web端管理员上(下)架课程
|
||||||
|
* @param commonRequest 课程id
|
||||||
|
* @return 课程信息
|
||||||
|
*/
|
||||||
|
@PostMapping("isShelves")
|
||||||
|
@Operation(summary = "web端管理员上(下)架课程", description = "参数:课程查询请求体,权限:管理员,方法名:updateCourseShelvesStatus")
|
||||||
|
@RequiresPermission(mustRole = UserConstant.ADMIN_ROLE)
|
||||||
|
@SysLog(title = "课程管理", content = "web端管理员上(下)架课程")
|
||||||
|
public BaseResponse<Boolean> updateCourseShelvesStatus(@Valid @RequestBody CommonRequest commonRequest) {
|
||||||
|
Long id = commonRequest.getId();
|
||||||
|
Course course = courseService.getById(id);
|
||||||
|
course.setIsShelves(!course.getIsShelves());
|
||||||
|
courseService.updateById(course);
|
||||||
|
return ResultUtils.success(true);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Web端管理员分页查询课程
|
||||||
|
* @param courseQueryRequest 课程查询请求体
|
||||||
|
* @return 课程列表
|
||||||
|
*/
|
||||||
|
@PostMapping("page")
|
||||||
|
@Operation(summary = "Web端管理员分页查询课程", description = "参数:课程查询请求体,权限:管理员,方法名:listCourseByPage")
|
||||||
|
@RequiresPermission(mustRole = UserConstant.ADMIN_ROLE)
|
||||||
|
@SysLog(title = "课程管理", content = "Web端管理员分页查询课程")
|
||||||
|
public BaseResponse<Page<CourseVO>> listCourseByPage(@Valid @RequestBody CourseQueryRequest courseQueryRequest) {
|
||||||
|
long current = courseQueryRequest.getCurrent();
|
||||||
|
long pageSize = courseQueryRequest.getPageSize();
|
||||||
|
QueryWrapper<Course> queryWrapper = courseService.getQueryWrapper(courseQueryRequest);
|
||||||
|
Page<Course> page = courseService.page(new Page<>(current, pageSize), queryWrapper);
|
||||||
|
List<Course> courseList = page.getRecords();
|
||||||
|
List<CourseVO> courseVOList = commonService.convertList(courseList, CourseVO.class);
|
||||||
|
Page<CourseVO> voPage = new Page<>(current, pageSize);
|
||||||
|
voPage.setRecords(courseVOList);
|
||||||
|
voPage.setPages(page.getPages());
|
||||||
|
voPage.setTotal(page.getTotal());
|
||||||
|
return ResultUtils.success(voPage);
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,218 @@
|
|||||||
|
package com.greenorange.promotion.controller.course;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
||||||
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
|
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.OrderStatusConstant;
|
||||||
|
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.CommonRequest;
|
||||||
|
import com.greenorange.promotion.model.dto.courseOrder.CourseOrderAddRequest;
|
||||||
|
import com.greenorange.promotion.model.dto.courseOrder.CourseOrderQueryRequest;
|
||||||
|
import com.greenorange.promotion.model.dto.courseOrder.CourseOrderUpdateRequest;
|
||||||
|
import com.greenorange.promotion.model.entity.Course;
|
||||||
|
import com.greenorange.promotion.model.entity.CourseOrder;
|
||||||
|
import com.greenorange.promotion.model.vo.course.CourseCardVO;
|
||||||
|
import com.greenorange.promotion.model.vo.courseOrder.CourseOrderCardVO;
|
||||||
|
import com.greenorange.promotion.model.vo.courseOrder.CourseOrderVO;
|
||||||
|
import com.greenorange.promotion.service.common.CommonService;
|
||||||
|
import com.greenorange.promotion.service.course.CourseOrderService;
|
||||||
|
import com.greenorange.promotion.service.course.CourseService;
|
||||||
|
import com.greenorange.promotion.utils.OrderNumberUtils;
|
||||||
|
import io.swagger.v3.oas.annotations.Operation;
|
||||||
|
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||||
|
import jakarta.annotation.Resource;
|
||||||
|
import jakarta.servlet.http.HttpServletRequest;
|
||||||
|
import jakarta.validation.Valid;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.springframework.web.bind.annotation.PostMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RequestBody;
|
||||||
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
|
|
||||||
|
import java.util.Collections;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 课程订单 控制器
|
||||||
|
*/
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("courseOrder")
|
||||||
|
@Slf4j
|
||||||
|
@Tag(name = "课程订单模块")
|
||||||
|
public class CourseOrderController {
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private CourseService courseService;
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private CourseOrderService courseOrderService;
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private CommonService commonService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 小程序端用户生成课程订单
|
||||||
|
* @param courseOrderAddRequest 课程id
|
||||||
|
* @return 是否添加成功
|
||||||
|
*/
|
||||||
|
@PostMapping("add")
|
||||||
|
@Operation(summary = "小程序端用户生成课程订单", description = "参数:课程id,权限:管理员,方法名:addCourseOrder")
|
||||||
|
@RequiresPermission(mustRole = UserConstant.DEFAULT_ROLE)
|
||||||
|
@SysLog(title = "课程订单管理", content = "小程序端用户生成课程订单")
|
||||||
|
public BaseResponse<Long> addCourseOrder(@Valid @RequestBody CourseOrderAddRequest courseOrderAddRequest, HttpServletRequest request) {
|
||||||
|
Long userId = (Long) request.getAttribute("userId");
|
||||||
|
Long courseId = courseOrderAddRequest.getCourseId();
|
||||||
|
Course course = courseService.getById(courseId);
|
||||||
|
ThrowUtils.throwIf(course == null, ErrorCode.OPERATION_ERROR, "该课程不存在");
|
||||||
|
CourseOrder courseOrder = commonService.copyProperties(course, CourseOrder.class);
|
||||||
|
courseOrder.setOrderNumber(OrderNumberUtils.generateOrderId());
|
||||||
|
courseOrder.setTotalAmount(course.getDiscountPrice());
|
||||||
|
courseOrder.setUserId(userId);
|
||||||
|
courseOrderService.save(courseOrder);
|
||||||
|
return ResultUtils.success(courseOrder.getId());
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 小程序端用户取消课程订单
|
||||||
|
* @param courseOrderAddRequest 课程id
|
||||||
|
* @return 是否添加成功
|
||||||
|
*/
|
||||||
|
@PostMapping("cancel")
|
||||||
|
@Operation(summary = "小程序端用户取消课程订单", description = "参数:订单id,权限:管理员,方法名:cancelCourseOrder")
|
||||||
|
@RequiresPermission(mustRole = UserConstant.DEFAULT_ROLE)
|
||||||
|
@SysLog(title = "课程订单管理", content = "小程序端用户取消课程订单")
|
||||||
|
public BaseResponse<Long> cancelCourseOrder(@Valid @RequestBody CourseOrderAddRequest courseOrderAddRequest) {
|
||||||
|
Long courseId = courseOrderAddRequest.getCourseId();
|
||||||
|
CourseOrder courseOrder = courseOrderService.getById(courseId);
|
||||||
|
ThrowUtils.throwIf(courseOrder == null || !courseOrder.getOrderStatus().equals(OrderStatusConstant.PENDING),
|
||||||
|
ErrorCode.OPERATION_ERROR, "该订单不存在或者订单状态错误");
|
||||||
|
LambdaUpdateWrapper<CourseOrder> updateWrapper = new LambdaUpdateWrapper<>();
|
||||||
|
updateWrapper.eq(CourseOrder::getId, courseId).set(CourseOrder::getOrderStatus, OrderStatusConstant.CLOSED);
|
||||||
|
courseOrderService.update(updateWrapper);
|
||||||
|
return ResultUtils.success(courseOrder.getId());
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 小程序端用户查询课程订单列表
|
||||||
|
* @return 课程订单列表
|
||||||
|
*/
|
||||||
|
@PostMapping("query/list")
|
||||||
|
@Operation(summary = "小程序端用户查询课程订单列表", description = "参数:无,权限:管理员,方法名:queryCourseOrderList")
|
||||||
|
@RequiresPermission(mustRole = UserConstant.DEFAULT_ROLE)
|
||||||
|
@SysLog(title = "课程订单管理", content = "小程序端用户查询课程订单列表")
|
||||||
|
public BaseResponse<List<CourseOrderCardVO>> queryCourseOrderList(HttpServletRequest request) {
|
||||||
|
Long userId = (Long) request.getAttribute("userId");
|
||||||
|
List<CourseOrder> courseOrderList = commonService.findByFieldEqTargetField(CourseOrder::getUserId, userId, courseOrderService);
|
||||||
|
List<CourseOrderCardVO> courseOrderCardVOS = commonService.convertList(courseOrderList, CourseOrderCardVO.class);
|
||||||
|
Collections.reverse(courseOrderCardVOS);
|
||||||
|
return ResultUtils.success(courseOrderCardVOS);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 小程序端用户根据id查询订单详情
|
||||||
|
* @return 课程订单列表
|
||||||
|
*/
|
||||||
|
@PostMapping("query/detail")
|
||||||
|
@Operation(summary = "小程序端用户根据id查询订单详情", description = "参数:订单id,权限:管理员,方法名:queryCourseOrderDetailById")
|
||||||
|
@RequiresPermission(mustRole = UserConstant.DEFAULT_ROLE)
|
||||||
|
@SysLog(title = "课程订单管理", content = "小程序端用户根据id查询订单详情")
|
||||||
|
public BaseResponse<CourseOrderVO> queryCourseOrderDetailById(@RequestBody CommonRequest commonRequest) {
|
||||||
|
Long id = commonRequest.getId();
|
||||||
|
CourseOrder courseOrder = courseOrderService.getById(id);
|
||||||
|
CourseOrderVO courseOrderVO = commonService.copyProperties(courseOrder, CourseOrderVO.class);
|
||||||
|
return ResultUtils.success(courseOrderVO);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* web端管理员根据id删除课程订单
|
||||||
|
* @param commonRequest 课程订单删除请求体
|
||||||
|
* @return 是否删除成功
|
||||||
|
*/
|
||||||
|
@PostMapping("delete")
|
||||||
|
@Operation(summary = "web端管理员根据id删除课程订单", description = "参数:课程订单删除请求体,权限:管理员,方法名:delCourseOrder")
|
||||||
|
@RequiresPermission(mustRole = UserConstant.ADMIN_ROLE)
|
||||||
|
@SysLog(title = "课程订单管理", content = "web端管理员根据id删除课程订单")
|
||||||
|
public BaseResponse<Boolean> delCourseOrder(@Valid @RequestBody CommonRequest commonRequest) {
|
||||||
|
Long id = commonRequest.getId();
|
||||||
|
CourseOrder courseOrder = courseOrderService.getById(id);
|
||||||
|
ThrowUtils.throwIf(courseOrder == null || !courseOrder.getOrderStatus().equals(OrderStatusConstant.CLOSED),
|
||||||
|
ErrorCode.OPERATION_ERROR, "该课程订单不存在或订单状态错误");
|
||||||
|
courseOrderService.removeById(id);
|
||||||
|
return ResultUtils.success(true);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* web端管理员批量删除课程订单
|
||||||
|
* @param commonBatchRequest 课程订单批量删除请求体
|
||||||
|
* @return 是否删除成功
|
||||||
|
*/
|
||||||
|
@PostMapping("delBatch")
|
||||||
|
@Operation(summary = "web端管理员批量删除课程订单", description = "参数:课程订单批量删除请求体,权限:管理员,方法名:delBatchCourseOrder")
|
||||||
|
@RequiresPermission(mustRole = UserConstant.ADMIN_ROLE)
|
||||||
|
@SysLog(title = "课程订单管理", content = "web端管理员批量删除课程订单")
|
||||||
|
public BaseResponse<Boolean> delBatchCourseOrder(@Valid @RequestBody CommonBatchRequest commonBatchRequest) {
|
||||||
|
List<Long> ids = commonBatchRequest.getIds();
|
||||||
|
LambdaQueryWrapper<CourseOrder> queryWrapper = new LambdaQueryWrapper<>();
|
||||||
|
queryWrapper.ne(CourseOrder::getOrderStatus, OrderStatusConstant.CLOSED);
|
||||||
|
long count = courseOrderService.count(queryWrapper);
|
||||||
|
ThrowUtils.throwIf(count > 0, ErrorCode.OPERATION_ERROR, "存在未关闭的课程订单");
|
||||||
|
courseOrderService.removeByIds(ids);
|
||||||
|
return ResultUtils.success(true);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* web端管理员根据id查询课程订单
|
||||||
|
* @param commonRequest 课程订单查询请求体
|
||||||
|
* @return 课程订单信息
|
||||||
|
*/
|
||||||
|
@PostMapping("queryById")
|
||||||
|
@Operation(summary = "web端管理员根据id查询课程订单", description = "参数:课程订单查询请求体,权限:管理员,方法名:queryCourseOrderById")
|
||||||
|
@RequiresPermission(mustRole = UserConstant.ADMIN_ROLE)
|
||||||
|
@SysLog(title = "课程订单管理", content = "web端管理员根据id查询课程订单")
|
||||||
|
public BaseResponse<CourseOrderVO> queryCourseOrderById(@Valid @RequestBody CommonRequest commonRequest) {
|
||||||
|
Long id = commonRequest.getId();
|
||||||
|
CourseOrder courseOrder = courseOrderService.getById(id);
|
||||||
|
CourseOrderVO courseOrderVO = commonService.copyProperties(courseOrder, CourseOrderVO.class);
|
||||||
|
return ResultUtils.success(courseOrderVO);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Web端管理员分页查询课程订单
|
||||||
|
* @param courseOrderQueryRequest 课程订单查询请求体
|
||||||
|
* @return 课程订单列表
|
||||||
|
*/
|
||||||
|
@PostMapping("page")
|
||||||
|
@Operation(summary = "Web端管理员分页查询课程订单", description = "参数:课程订单查询请求体,权限:管理员,方法名:listCourseOrderByPage")
|
||||||
|
@RequiresPermission(mustRole = UserConstant.ADMIN_ROLE)
|
||||||
|
@SysLog(title = "课程订单管理", content = "Web端管理员分页查询课程订单")
|
||||||
|
public BaseResponse<Page<CourseOrderVO>> listCourseOrderByPage(@Valid @RequestBody CourseOrderQueryRequest courseOrderQueryRequest) {
|
||||||
|
long current = courseOrderQueryRequest.getCurrent();
|
||||||
|
long pageSize = courseOrderQueryRequest.getPageSize();
|
||||||
|
QueryWrapper<CourseOrder> queryWrapper = courseOrderService.getQueryWrapper(courseOrderQueryRequest);
|
||||||
|
Page<CourseOrder> page = courseOrderService.page(new Page<>(current, pageSize), queryWrapper);
|
||||||
|
List<CourseOrder> courseOrderList = page.getRecords();
|
||||||
|
List<CourseOrderVO> courseOrderVOList = commonService.convertList(courseOrderList, CourseOrderVO.class);
|
||||||
|
Page<CourseOrderVO> voPage = new Page<>(current, pageSize);
|
||||||
|
voPage.setRecords(courseOrderVOList);
|
||||||
|
voPage.setPages(page.getPages());
|
||||||
|
voPage.setTotal(page.getTotal());
|
||||||
|
return ResultUtils.success(voPage);
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,15 @@
|
|||||||
|
package com.greenorange.promotion.controller.practice;
|
||||||
|
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
|
||||||
|
@NoArgsConstructor
|
||||||
|
|
||||||
|
@AllArgsConstructor
|
||||||
|
|
||||||
|
public class IdCardNumRequest {
|
||||||
|
private String idcardnum;
|
||||||
|
}
|
@ -0,0 +1,16 @@
|
|||||||
|
package com.greenorange.promotion.controller.practice;
|
||||||
|
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
import org.checkerframework.checker.units.qual.A;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
|
||||||
|
@NoArgsConstructor
|
||||||
|
|
||||||
|
@AllArgsConstructor
|
||||||
|
|
||||||
|
public class Project_commission {
|
||||||
|
private Long userid;
|
||||||
|
}
|
@ -0,0 +1,15 @@
|
|||||||
|
package com.greenorange.promotion.controller.practice;
|
||||||
|
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
|
||||||
|
@NoArgsConstructor
|
||||||
|
|
||||||
|
@AllArgsConstructor
|
||||||
|
|
||||||
|
public class Promo_code_apply {
|
||||||
|
private Long userid;
|
||||||
|
}
|
@ -0,0 +1,19 @@
|
|||||||
|
package com.greenorange.promotion.controller.practice;
|
||||||
|
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
|
//有get,set方法,to-string方法
|
||||||
|
@Data
|
||||||
|
//无参构造函数
|
||||||
|
@NoArgsConstructor
|
||||||
|
//全参构造函数
|
||||||
|
@AllArgsConstructor
|
||||||
|
public class QueryRequest {
|
||||||
|
private Long pagesize;
|
||||||
|
|
||||||
|
|
||||||
|
private Long pagenum;
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,16 @@
|
|||||||
|
package com.greenorange.promotion.controller.practice;
|
||||||
|
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
|
||||||
|
@NoArgsConstructor
|
||||||
|
|
||||||
|
@AllArgsConstructor
|
||||||
|
|
||||||
|
public class Toselect {
|
||||||
|
private String phoneNumber;
|
||||||
|
private String bankNumber;
|
||||||
|
}
|
@ -0,0 +1,223 @@
|
|||||||
|
package com.greenorange.promotion.controller.practice;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||||
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
|
import com.greenorange.promotion.common.BaseResponse;
|
||||||
|
import com.greenorange.promotion.common.ErrorCode;
|
||||||
|
import com.greenorange.promotion.common.ResultUtils;
|
||||||
|
import com.greenorange.promotion.exception.BusinessException;
|
||||||
|
import com.greenorange.promotion.model.dto.CommonRequest;
|
||||||
|
import com.greenorange.promotion.model.dto.userAccount.UserAccountAddRequest;
|
||||||
|
import com.greenorange.promotion.model.dto.userAccount.UserAccountUpdateRequest;
|
||||||
|
import com.greenorange.promotion.model.entity.ProjectCommission;
|
||||||
|
import com.greenorange.promotion.model.entity.PromoCodeApply;
|
||||||
|
import com.greenorange.promotion.model.entity.UserAccount;
|
||||||
|
import com.greenorange.promotion.service.project.ProjectCommissionService;
|
||||||
|
import com.greenorange.promotion.service.project.PromoCodeApplyService;
|
||||||
|
import com.greenorange.promotion.service.project.impl.PromoCodeApplyServiceImpl;
|
||||||
|
import com.greenorange.promotion.service.settle.UserAccountService;
|
||||||
|
import jakarta.annotation.Resource;
|
||||||
|
import org.checkerframework.common.util.report.qual.ReportWrite;
|
||||||
|
import org.jacoco.agent.rt.internal_f3994fa.IExceptionLogger;
|
||||||
|
import org.springframework.beans.BeanUtils;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
import java.util.*;
|
||||||
|
|
||||||
|
//@ResponseBody 把返回值传到浏览器上
|
||||||
|
//@Controller 把当前类的对象创建出来,存放到SpringIOC容器,
|
||||||
|
//@RestController = @Controller + @ResponseBody
|
||||||
|
@RestController
|
||||||
|
// ip + 端口号用于运行这个服务
|
||||||
|
// ip + 端口号 + /test/hello
|
||||||
|
// @Controller @Service @Mapper 把当前类的对象创建出来,存放到SpringIOC容器,
|
||||||
|
@RequestMapping("test")
|
||||||
|
public class UserAccountTestController {
|
||||||
|
|
||||||
|
// 对userAccount表实现功能
|
||||||
|
// 1.插入,删除,修改,全部查询,根据id查询
|
||||||
|
@Resource
|
||||||
|
// 从容器中取出名字为userAccountService的对象
|
||||||
|
private UserAccountService userAccountService;
|
||||||
|
|
||||||
|
@PostMapping("/add")
|
||||||
|
public BaseResponse<String> add(@RequestBody UserAccountAddRequest userAccountAddRequest){
|
||||||
|
if (userAccountAddRequest == null) {
|
||||||
|
throw new BusinessException(ErrorCode.PARAMS_ERROR, "请求参数不能为空");
|
||||||
|
}
|
||||||
|
if (userAccountAddRequest.getBankCardNumber() == null ||
|
||||||
|
userAccountAddRequest.getPhoneNumber() == null ||
|
||||||
|
userAccountAddRequest.getIdCardNumber() == null ||
|
||||||
|
userAccountAddRequest.getCardHolder() == null ||
|
||||||
|
userAccountAddRequest.getOpenBank() == null) {
|
||||||
|
throw new BusinessException(ErrorCode.PARAMS_ERROR, "必填字段不能为空");
|
||||||
|
}
|
||||||
|
UserAccount userAccount = new UserAccount();
|
||||||
|
// userAccount.setId(null);
|
||||||
|
// userAccount.setBankCardNumber(userAccountAddRequest.getBankCardNumber());
|
||||||
|
// userAccount.setOpenBank(userAccountAddRequest.getOpenBank());
|
||||||
|
// userAccount.setPhoneNumber(userAccountAddRequest.getPhoneNumber());
|
||||||
|
// userAccount.setIdCardNumber(userAccountAddRequest.getIdCardNumber());
|
||||||
|
// userAccount.setCardHolder(userAccountAddRequest.getCardHolder());
|
||||||
|
// userAccount.setUserId(1L);
|
||||||
|
BeanUtils.copyProperties(userAccountAddRequest, userAccount);
|
||||||
|
boolean result = userAccountService.save(userAccount);
|
||||||
|
if (!result) {
|
||||||
|
throw new BusinessException(ErrorCode.SYSTEM_ERROR, "新增用户账户失败");
|
||||||
|
}
|
||||||
|
return ResultUtils.success("插入成功");
|
||||||
|
}
|
||||||
|
|
||||||
|
// @GetMapping("/delete")
|
||||||
|
// public String delete(@RequestParam Long id) {
|
||||||
|
// boolean removed = userAccountService.removeById(id);
|
||||||
|
// return removed ? "删除成功" : "删除失败";
|
||||||
|
|
||||||
|
|
||||||
|
// @GetMapping("/delete/{id}")
|
||||||
|
// public String delete(@PathVariable Long id) {
|
||||||
|
// boolean removed = userAccountService.removeById(id);
|
||||||
|
// return removed ? "删除成功" : "删除失败";
|
||||||
|
// }
|
||||||
|
|
||||||
|
|
||||||
|
@PostMapping("/delete")
|
||||||
|
public BaseResponse<String> delete(@RequestBody CommonRequest commonRequest){
|
||||||
|
Long id = commonRequest.getId();
|
||||||
|
if(id == null) throw new BusinessException(ErrorCode.PARAMS_ERROR, "请求参数 id 不能为空");
|
||||||
|
boolean removed = userAccountService.removeById(id);
|
||||||
|
return ResultUtils.success(removed ? "删除成功" : "删除失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
@PostMapping("/update")
|
||||||
|
public BaseResponse<String> update(@RequestBody UserAccountUpdateRequest userAccountUpdateRequest){
|
||||||
|
if (userAccountUpdateRequest == null || userAccountUpdateRequest.getId() == null) {
|
||||||
|
throw new BusinessException(ErrorCode.PARAMS_ERROR, "更新操作必须提供 ID");
|
||||||
|
}
|
||||||
|
UserAccount existing = userAccountService.getById(userAccountUpdateRequest.getId());
|
||||||
|
if (existing == null) {
|
||||||
|
throw new BusinessException(ErrorCode.NOT_FOUND_ERROR, "要更新的用户账户不存在");
|
||||||
|
}
|
||||||
|
UserAccount userAccount = new UserAccount();
|
||||||
|
// userAccount.setId(userAccountUpdateRequest.getId());
|
||||||
|
// userAccount.setOpenBank(userAccountUpdateRequest.getOpenBank());
|
||||||
|
// userAccount.setPhoneNumber(userAccountUpdateRequest.getPhoneNumber());
|
||||||
|
// userAccount.setCardHolder(userAccountUpdateRequest.getCardHolder());
|
||||||
|
// userAccount.setIdCardNumber(userAccountUpdateRequest.getIdCardNumber());
|
||||||
|
// userAccount.setUserId(1L);
|
||||||
|
BeanUtils.copyProperties(userAccountUpdateRequest, userAccount);
|
||||||
|
userAccountService.updateById(userAccount);
|
||||||
|
boolean result = userAccountService.updateById(userAccount);
|
||||||
|
if (!result) {
|
||||||
|
throw new BusinessException(ErrorCode.SYSTEM_ERROR, "更新失败,请稍后再试");
|
||||||
|
}
|
||||||
|
return ResultUtils.success("更新成功");
|
||||||
|
}
|
||||||
|
|
||||||
|
//根据id查询
|
||||||
|
@PostMapping("/select")
|
||||||
|
public BaseResponse<UserAccount> select(@RequestBody CommonRequest commonRequest){
|
||||||
|
Long id = commonRequest.getId();
|
||||||
|
if (id == null) {
|
||||||
|
throw new BusinessException(ErrorCode.PARAMS_ERROR, "请求参数 id 不能为空");
|
||||||
|
}
|
||||||
|
UserAccount selected = userAccountService.getById(id);
|
||||||
|
if (selected == null) {
|
||||||
|
throw new BusinessException(ErrorCode.NOT_FOUND_ERROR, "未找到对应的用户记录");
|
||||||
|
}
|
||||||
|
return ResultUtils.success(selected);
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping("success")
|
||||||
|
public BaseResponse<String> test() {
|
||||||
|
for (int i = 0; i < 10; i ++ )
|
||||||
|
System.out.println("运行了这个程序");
|
||||||
|
String template = "运行程序";
|
||||||
|
return ResultUtils.success(template);
|
||||||
|
// return new BaseResponse<>(1, template, "ok");
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//查询所有数据
|
||||||
|
@PostMapping("/list")
|
||||||
|
public BaseResponse<List<UserAccount>> list(){
|
||||||
|
// 这里你可以根据 queryRequest 构造查询条件
|
||||||
|
return ResultUtils.success(userAccountService.list());
|
||||||
|
}
|
||||||
|
|
||||||
|
//分页查询
|
||||||
|
// @PostMapping("/pagelist")
|
||||||
|
// public BaseResponse<List<UserAccount>> pagelist(@RequestBody QueryRequest queryRequest){
|
||||||
|
// System.out.println(queryRequest.toString());
|
||||||
|
// Long start = queryRequest.getPagesize() * (queryRequest.getPagenum() - 1);
|
||||||
|
// List<UserAccount> list = userAccountService.list();
|
||||||
|
// List<UserAccount> newlist = list.subList(start.intValue(), start.intValue() + queryRequest.getPagesize().intValue());
|
||||||
|
// return ResultUtils.success(newlist);
|
||||||
|
// }
|
||||||
|
@PostMapping("/pagelist")
|
||||||
|
public BaseResponse<Page<UserAccount>> pagelist(@RequestBody QueryRequest queryRequest){
|
||||||
|
Long pagesize = queryRequest.getPagesize();
|
||||||
|
Long pagenum = queryRequest.getPagenum();
|
||||||
|
Page<UserAccount> userAccountPage = new Page<>(pagenum, pagesize);//分页的规则
|
||||||
|
Page<UserAccount> page = userAccountService.page(userAccountPage);//根据分页规则取出集合里对应的部分
|
||||||
|
return ResultUtils.success(page);
|
||||||
|
}
|
||||||
|
|
||||||
|
//根据IdCardnum查询
|
||||||
|
@PostMapping("/idcardnumselect")
|
||||||
|
public BaseResponse<UserAccount> idcardnumselect(@RequestBody IdCardNumRequest idCardNumRequest) throws Exception {
|
||||||
|
String idcardnum = idCardNumRequest.getIdcardnum();
|
||||||
|
// LambdaQueryWrapper<UserAccount> queryWrapper = new LambdaQueryWrapper<>();
|
||||||
|
QueryWrapper<UserAccount> queryWrapper = new QueryWrapper<>();
|
||||||
|
// queryWrapper.eq(UserAccount::getIdCardNumber, idcardnum);
|
||||||
|
queryWrapper.eq("idCardNumber", idcardnum);
|
||||||
|
UserAccount userAccount = userAccountService.getOne(queryWrapper);
|
||||||
|
if(userAccount == null) throw new BusinessException(ErrorCode.NOT_FOUND_ERROR, "这条记录不存在");
|
||||||
|
// if(userAccount == null) ResultUtils.error(ErrorCode.NOT_FOUND_ERROR);
|
||||||
|
return ResultUtils.success(userAccount);
|
||||||
|
}
|
||||||
|
|
||||||
|
//根据phoneNumber,bankCardNumber
|
||||||
|
@PostMapping("phonebankNumberselect")
|
||||||
|
public BaseResponse<List<UserAccount>> phonebankselect(@RequestBody Toselect toselect){
|
||||||
|
String phoneNumber = toselect.getPhoneNumber();
|
||||||
|
String bankNumber = toselect.getBankNumber();
|
||||||
|
LambdaQueryWrapper<UserAccount> queryWrapper = new LambdaQueryWrapper<>();
|
||||||
|
queryWrapper.eq(UserAccount::getPhoneNumber, phoneNumber);
|
||||||
|
queryWrapper.eq(UserAccount::getBankCardNumber, bankNumber);
|
||||||
|
List<UserAccount> list = userAccountService.list(queryWrapper);
|
||||||
|
if (list == null || list.isEmpty()) {
|
||||||
|
throw new BusinessException(ErrorCode.NOT_FOUND_ERROR, "没有符合条件的用户账户信息");
|
||||||
|
}
|
||||||
|
return ResultUtils.success(list);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private PromoCodeApplyService promoCodeApplyService;
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private ProjectCommissionService projectCommissionService;
|
||||||
|
|
||||||
|
|
||||||
|
@PostMapping("/queryByIds")
|
||||||
|
public BaseResponse<List<ProjectCommission>> phonebankselectHello(){
|
||||||
|
List<PromoCodeApply> list = promoCodeApplyService.list();
|
||||||
|
List<Long> ids = list.stream().map(PromoCodeApply::getUserId).toList();
|
||||||
|
LambdaQueryWrapper<ProjectCommission> lambdaQueryWrapper = new LambdaQueryWrapper<>();
|
||||||
|
lambdaQueryWrapper.in(ProjectCommission::getUserId, ids);
|
||||||
|
List<ProjectCommission> projectCommissions = projectCommissionService.list(lambdaQueryWrapper);
|
||||||
|
|
||||||
|
return ResultUtils.success(projectCommissions);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
// @GetMapping("error")
|
||||||
|
// public BaseResponse<String> error() throws Exception {
|
||||||
|
//// String error = "空指针异常";
|
||||||
|
// String template = null;
|
||||||
|
// if (template == null) throw new Exception("空指针异常");
|
||||||
|
// return ResultUtils.success("error");
|
||||||
|
// }
|
||||||
|
|
||||||
|
}
|
@ -33,14 +33,15 @@ import jakarta.servlet.http.HttpServletRequest;
|
|||||||
import jakarta.validation.Valid;
|
import jakarta.validation.Valid;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.springframework.data.redis.core.RedisTemplate;
|
import org.springframework.data.redis.core.RedisTemplate;
|
||||||
|
import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder;
|
||||||
|
import org.springframework.security.crypto.password.PasswordEncoder;
|
||||||
import org.springframework.web.bind.annotation.*;
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
|
import java.lang.reflect.GenericDeclaration;
|
||||||
import java.math.BigDecimal;
|
import java.math.BigDecimal;
|
||||||
import java.math.RoundingMode;
|
import java.math.RoundingMode;
|
||||||
import java.util.ArrayList;
|
import java.util.*;
|
||||||
import java.util.HashMap;
|
import java.util.stream.Collectors;
|
||||||
import java.util.List;
|
|
||||||
import java.util.Map;
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -141,6 +142,49 @@ public class ProjectCommissionController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// public static void main(String[] args) {
|
||||||
|
// PasswordEncoder passwordEncoder = new BCryptPasswordEncoder();
|
||||||
|
// String encode = passwordEncoder.encode("123456");
|
||||||
|
// System.out.println(encode);
|
||||||
|
// boolean matches = passwordEncoder.matches("123456", "$2a$10$/yBGQqsHK78vlEtuMGTVY.bU/TamHQbr4wQIzj1B1H1ud/ZKPGICC");
|
||||||
|
// System.out.println(matches);
|
||||||
|
// }
|
||||||
|
|
||||||
|
|
||||||
|
//
|
||||||
|
// /**
|
||||||
|
// * 小程序用户修改项目的抽佣比例
|
||||||
|
// * @param projectCommissionUpdateRequest 项目明细抽佣更新请求体
|
||||||
|
// * @return 是否添加成功
|
||||||
|
// */
|
||||||
|
// @PostMapping("update/rate")
|
||||||
|
// @Operation(summary = "小程序用户修改项目的抽佣比例", description = "参数:项目明细抽佣更新请求体,权限:管理员,方法名:updateProjectCommissionRate")
|
||||||
|
// @RequiresPermission(mustRole = UserConstant.DEFAULT_ROLE)
|
||||||
|
//// @SysLog(title = "项目明细抽佣管理", content = "小程序用户修改项目的抽佣比例")
|
||||||
|
// public BaseResponse<Boolean> updateProjectCommissionRate(@Valid @RequestBody ProjectCommissionUpdateRequest projectCommissionUpdateRequest, HttpServletRequest request) {
|
||||||
|
// Long id = projectCommissionUpdateRequest.getId();
|
||||||
|
// 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");
|
||||||
|
// Map<SFunction<SubUserProjectCommission, ?>, Object> fieldConditions = Map.of(SubUserProjectCommission::getProjectDetailId, projectDetailId, SubUserProjectCommission::getUserId, userId);
|
||||||
|
// List<SubUserProjectCommission> subUserProjectCommissionList = commonService.findByFieldEqTargetFields(fieldConditions, subUserProjectCommissionService);
|
||||||
|
// for (SubUserProjectCommission subUserProjectCommission : subUserProjectCommissionList) {
|
||||||
|
// subUserProjectCommission.setCurrentCommissionRate(currentCommissionRate);
|
||||||
|
// }
|
||||||
|
// subUserProjectCommissionService.updateBatchById(subUserProjectCommissionList);
|
||||||
|
// return ResultUtils.success(true);
|
||||||
|
// }
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 小程序用户修改项目的抽佣比例
|
* 小程序用户修改项目的抽佣比例
|
||||||
* @param projectCommissionUpdateRequest 项目明细抽佣更新请求体
|
* @param projectCommissionUpdateRequest 项目明细抽佣更新请求体
|
||||||
@ -151,30 +195,11 @@ public class ProjectCommissionController {
|
|||||||
@RequiresPermission(mustRole = UserConstant.DEFAULT_ROLE)
|
@RequiresPermission(mustRole = UserConstant.DEFAULT_ROLE)
|
||||||
// @SysLog(title = "项目明细抽佣管理", content = "小程序用户修改项目的抽佣比例")
|
// @SysLog(title = "项目明细抽佣管理", content = "小程序用户修改项目的抽佣比例")
|
||||||
public BaseResponse<Boolean> updateProjectCommissionRate(@Valid @RequestBody ProjectCommissionUpdateRequest projectCommissionUpdateRequest, HttpServletRequest request) {
|
public BaseResponse<Boolean> updateProjectCommissionRate(@Valid @RequestBody ProjectCommissionUpdateRequest projectCommissionUpdateRequest, HttpServletRequest request) {
|
||||||
Long id = projectCommissionUpdateRequest.getId();
|
projectCommissionService.updateProjectCommissionRate(projectCommissionUpdateRequest);
|
||||||
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");
|
|
||||||
Map<SFunction<SubUserProjectCommission, ?>, Object> fieldConditions = Map.of(SubUserProjectCommission::getProjectDetailId, projectDetailId, SubUserProjectCommission::getUserId, userId);
|
|
||||||
List<SubUserProjectCommission> subUserProjectCommissionList = commonService.findByFieldEqTargetFields(fieldConditions, subUserProjectCommissionService);
|
|
||||||
for (SubUserProjectCommission subUserProjectCommission : subUserProjectCommissionList) {
|
|
||||||
subUserProjectCommission.setCurrentCommissionRate(currentCommissionRate);
|
|
||||||
}
|
|
||||||
subUserProjectCommissionService.updateBatchById(subUserProjectCommissionList);
|
|
||||||
return ResultUtils.success(true);
|
return ResultUtils.success(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 小程序用户查看下级用户的项目明细抽佣情况
|
* 小程序用户查看下级用户的项目明细抽佣情况
|
||||||
* @param commonRequest 项目id
|
* @param commonRequest 项目id
|
||||||
@ -249,6 +274,30 @@ public class ProjectCommissionController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// /**
|
||||||
|
// * 小程序用户修改下级用户的项目明细抽佣比例
|
||||||
|
// * @param subUserProjectCommissionUpdateRequest 下级用户项目明细抽佣更新请求体
|
||||||
|
// * @return 是否添加成功
|
||||||
|
// */
|
||||||
|
// @PostMapping("update/sub/rate")
|
||||||
|
// @Operation(summary = "小程序用户修改下级用户的项目明细抽佣比例", description = "参数:下级用户项目明细抽佣更新请求体,权限:管理员,方法名:updateSubUserProjectCommissionRate")
|
||||||
|
// @RequiresPermission(mustRole = UserConstant.DEFAULT_ROLE)
|
||||||
|
//// @SysLog(title = "项目明细抽佣管理", content = "小程序用户修改下级用户的项目明细抽佣比例")
|
||||||
|
// public BaseResponse<Boolean> updateSubUserProjectCommissionRate(@Valid @RequestBody SubUserProjectCommissionUpdateRequest subUserProjectCommissionUpdateRequest) {
|
||||||
|
// Long id = subUserProjectCommissionUpdateRequest.getId();
|
||||||
|
// BigDecimal currentCommissionRate = subUserProjectCommissionUpdateRequest.getCurrentCommissionRate();
|
||||||
|
// // 校验当前抽佣比例不能大于最大抽佣比例
|
||||||
|
// SubUserProjectCommission subUserProjectCommission = subUserProjectCommissionService.getById(id);
|
||||||
|
// Long projectDetailId = subUserProjectCommission.getProjectDetailId();
|
||||||
|
// ProjectDetail projectDetail = projectDetailService.getById(projectDetailId);
|
||||||
|
// BigDecimal maxCommissionRate = projectDetail.getMaxCommissionRate();
|
||||||
|
// ThrowUtils.throwIf(currentCommissionRate.compareTo(maxCommissionRate) > 0, ErrorCode.OPERATION_ERROR, "当前抽佣比例不能大于最大抽佣比例");
|
||||||
|
// subUserProjectCommission.setCurrentCommissionRate(currentCommissionRate);
|
||||||
|
// subUserProjectCommissionService.updateById(subUserProjectCommission);
|
||||||
|
// return ResultUtils.success(true);
|
||||||
|
// }
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 小程序用户修改下级用户的项目明细抽佣比例
|
* 小程序用户修改下级用户的项目明细抽佣比例
|
||||||
* @param subUserProjectCommissionUpdateRequest 下级用户项目明细抽佣更新请求体
|
* @param subUserProjectCommissionUpdateRequest 下级用户项目明细抽佣更新请求体
|
||||||
@ -259,20 +308,63 @@ public class ProjectCommissionController {
|
|||||||
@RequiresPermission(mustRole = UserConstant.DEFAULT_ROLE)
|
@RequiresPermission(mustRole = UserConstant.DEFAULT_ROLE)
|
||||||
// @SysLog(title = "项目明细抽佣管理", content = "小程序用户修改下级用户的项目明细抽佣比例")
|
// @SysLog(title = "项目明细抽佣管理", content = "小程序用户修改下级用户的项目明细抽佣比例")
|
||||||
public BaseResponse<Boolean> updateSubUserProjectCommissionRate(@Valid @RequestBody SubUserProjectCommissionUpdateRequest subUserProjectCommissionUpdateRequest) {
|
public BaseResponse<Boolean> updateSubUserProjectCommissionRate(@Valid @RequestBody SubUserProjectCommissionUpdateRequest subUserProjectCommissionUpdateRequest) {
|
||||||
Long id = subUserProjectCommissionUpdateRequest.getId();
|
projectCommissionService.updateSubUserProjectCommissionRate(subUserProjectCommissionUpdateRequest);
|
||||||
BigDecimal currentCommissionRate = subUserProjectCommissionUpdateRequest.getCurrentCommissionRate();
|
|
||||||
// 校验当前抽佣比例不能大于最大抽佣比例
|
|
||||||
SubUserProjectCommission subUserProjectCommission = subUserProjectCommissionService.getById(id);
|
|
||||||
Long projectDetailId = subUserProjectCommission.getProjectDetailId();
|
|
||||||
ProjectDetail projectDetail = projectDetailService.getById(projectDetailId);
|
|
||||||
BigDecimal maxCommissionRate = projectDetail.getMaxCommissionRate();
|
|
||||||
ThrowUtils.throwIf(currentCommissionRate.compareTo(maxCommissionRate) > 0, ErrorCode.OPERATION_ERROR, "当前抽佣比例不能大于最大抽佣比例");
|
|
||||||
subUserProjectCommission.setCurrentCommissionRate(currentCommissionRate);
|
|
||||||
subUserProjectCommissionService.updateById(subUserProjectCommission);
|
|
||||||
return ResultUtils.success(true);
|
return ResultUtils.success(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// /**
|
||||||
|
// * 小程序用户一键设置项目的的抽佣比例
|
||||||
|
// * @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();
|
||||||
|
//
|
||||||
|
// // 修改项目的统一抽佣比例
|
||||||
|
// LambdaUpdateWrapper<UserMainInfo> userMainInfoLambdaUpdateWrapper = new LambdaUpdateWrapper<>();
|
||||||
|
// userMainInfoLambdaUpdateWrapper.eq(UserMainInfo::getUserId, userId).set(UserMainInfo::getUniteRate, uniteCommissionRate);
|
||||||
|
// userMainInfoService.update(userMainInfoLambdaUpdateWrapper);
|
||||||
|
//
|
||||||
|
// 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, ProjectDetail::getId);
|
||||||
|
// // 封装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);
|
||||||
|
// }
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 小程序用户一键设置项目的的抽佣比例
|
* 小程序用户一键设置项目的的抽佣比例
|
||||||
* @param projectCommissionUniteUpdateRequest 统一抽佣比例
|
* @param projectCommissionUniteUpdateRequest 统一抽佣比例
|
||||||
@ -283,43 +375,7 @@ public class ProjectCommissionController {
|
|||||||
@RequiresPermission(mustRole = UserConstant.DEFAULT_ROLE)
|
@RequiresPermission(mustRole = UserConstant.DEFAULT_ROLE)
|
||||||
// @SysLog(title = "项目明细抽佣管理", content = "小程序用户一键设置项目的的抽佣比例")
|
// @SysLog(title = "项目明细抽佣管理", content = "小程序用户一键设置项目的的抽佣比例")
|
||||||
public BaseResponse<Boolean> uniteProjectCommissionRate(@Valid @RequestBody ProjectCommissionUniteUpdateRequest projectCommissionUniteUpdateRequest, HttpServletRequest request) {
|
public BaseResponse<Boolean> uniteProjectCommissionRate(@Valid @RequestBody ProjectCommissionUniteUpdateRequest projectCommissionUniteUpdateRequest, HttpServletRequest request) {
|
||||||
Long userId = (Long) request.getAttribute("userId");
|
projectCommissionService.uniteProjectCommissionRate(projectCommissionUniteUpdateRequest, request);
|
||||||
BigDecimal uniteCommissionRate = projectCommissionUniteUpdateRequest.getUniteCommissionRate();
|
|
||||||
|
|
||||||
// 修改项目的统一抽佣比例
|
|
||||||
LambdaUpdateWrapper<UserMainInfo> userMainInfoLambdaUpdateWrapper = new LambdaUpdateWrapper<>();
|
|
||||||
userMainInfoLambdaUpdateWrapper.eq(UserMainInfo::getUserId, userId).set(UserMainInfo::getUniteRate, uniteCommissionRate);
|
|
||||||
userMainInfoService.update(userMainInfoLambdaUpdateWrapper);
|
|
||||||
|
|
||||||
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, ProjectDetail::getId);
|
|
||||||
// 封装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);
|
return ResultUtils.success(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -91,27 +91,7 @@ public class ProjectController {
|
|||||||
@RequiresPermission(mustRole = UserConstant.DEFAULT_ROLE)
|
@RequiresPermission(mustRole = UserConstant.DEFAULT_ROLE)
|
||||||
// @SysLog(title = "项目管理", content = "小程序用户查看项目列表")
|
// @SysLog(title = "项目管理", content = "小程序用户查看项目列表")
|
||||||
public BaseResponse<List<ProjectCardVO>> queryProjectCardList(HttpServletRequest request) {
|
public BaseResponse<List<ProjectCardVO>> queryProjectCardList(HttpServletRequest request) {
|
||||||
Long userId = (Long) request.getAttribute("userId");
|
List<ProjectCardVO> projectCardVOS = projectService.queryProjectCardList(request);
|
||||||
// 获取项目明细抽佣列表
|
|
||||||
List<ProjectCommission> projectCommissionList = commonService.findByFieldEqTargetField(ProjectCommission::getUserId, userId, projectCommissionService);
|
|
||||||
// 封装Map集合(键:项目id, 值:项目总价)
|
|
||||||
Map<Long, BigDecimal> projectPriceMap = new HashMap<>();
|
|
||||||
for (ProjectCommission projectCommission : projectCommissionList) {
|
|
||||||
Long projectId = projectCommission.getProjectId();
|
|
||||||
BigDecimal projectPrice = projectPriceMap.get(projectId);
|
|
||||||
if (projectPrice == null) {
|
|
||||||
projectPrice = projectCommission.getMyUnitPrice();
|
|
||||||
} else {
|
|
||||||
projectPrice = projectPrice.add(projectCommission.getMyUnitPrice());
|
|
||||||
}
|
|
||||||
projectPriceMap.put(projectId, projectPrice);
|
|
||||||
}
|
|
||||||
List<Project> projectList = commonService.findByFieldEqTargetField(Project::getIsShelves, 1, projectService);
|
|
||||||
for (Project project : projectList) {
|
|
||||||
BigDecimal projectPrice = projectPriceMap.get(project.getId());
|
|
||||||
project.setProjectPrice(projectPrice == null ? BigDecimal.ZERO : projectPrice);
|
|
||||||
}
|
|
||||||
List<ProjectCardVO> projectCardVOS = commonService.convertList(projectList, ProjectCardVO.class);
|
|
||||||
return ResultUtils.success(projectCardVOS);
|
return ResultUtils.success(projectCardVOS);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -281,10 +261,7 @@ public class ProjectController {
|
|||||||
@RequiresPermission(mustRole = UserConstant.ADMIN_ROLE)
|
@RequiresPermission(mustRole = UserConstant.ADMIN_ROLE)
|
||||||
@SysLog(title = "项目管理", content = "web端管理员根据id查询项目")
|
@SysLog(title = "项目管理", content = "web端管理员根据id查询项目")
|
||||||
public BaseResponse<ProjectVO> queryProjectById(@Valid @RequestBody CommonRequest commonRequest) {
|
public BaseResponse<ProjectVO> queryProjectById(@Valid @RequestBody CommonRequest commonRequest) {
|
||||||
Long id = commonRequest.getId();
|
ProjectVO projectVO = projectService.queryProjectById(commonRequest);
|
||||||
Project project = projectService.getById(id);
|
|
||||||
ThrowUtils.throwIf(project == null, ErrorCode.OPERATION_ERROR, "当前项目不存在");
|
|
||||||
ProjectVO projectVO = commonService.copyProperties(project, ProjectVO.class);
|
|
||||||
return ResultUtils.success(projectVO);
|
return ResultUtils.success(projectVO);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -22,6 +22,7 @@ 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.project.SubUserProjectCommissionService;
|
||||||
import com.greenorange.promotion.service.userInfo.UserInfoService;
|
import com.greenorange.promotion.service.userInfo.UserInfoService;
|
||||||
|
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;
|
||||||
@ -65,6 +66,9 @@ public class ProjectDetailController {
|
|||||||
@Resource
|
@Resource
|
||||||
private ProjectService projectService;
|
private ProjectService projectService;
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private UserMainInfoService userMainInfoService;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* web端管理员添加项目明细
|
* web端管理员添加项目明细
|
||||||
* @param projectDetailAddRequest 项目明细添加请求体
|
* @param projectDetailAddRequest 项目明细添加请求体
|
||||||
@ -89,6 +93,13 @@ public class ProjectDetailController {
|
|||||||
|
|
||||||
// 获取所有的小程序用户
|
// 获取所有的小程序用户
|
||||||
List<UserInfo> userInfoList = commonService.findByFieldEqTargetField(UserInfo::getUserRole, UserConstant.DEFAULT_ROLE, userInfoService);
|
List<UserInfo> userInfoList = commonService.findByFieldEqTargetField(UserInfo::getUserRole, UserConstant.DEFAULT_ROLE, userInfoService);
|
||||||
|
List<UserMainInfo> userMainInfoList = commonService.findByFieldInTargetField(userInfoList, userMainInfoService, UserInfo::getId, UserMainInfo::getUserId);
|
||||||
|
// 封装Map(键:用户id, 值:抽佣比例)
|
||||||
|
Map<Long, BigDecimal> userCommissionRateMap = new HashMap<>();
|
||||||
|
for (UserMainInfo userMainInfo : userMainInfoList) {
|
||||||
|
userCommissionRateMap.put(userMainInfo.getUserId(), userMainInfo.getUniteRate());
|
||||||
|
}
|
||||||
|
|
||||||
// 获取参数信息
|
// 获取参数信息
|
||||||
List<ProjectCommissionAddRequest> projectCommissionAddRequestList = new ArrayList<>();
|
List<ProjectCommissionAddRequest> projectCommissionAddRequestList = new ArrayList<>();
|
||||||
Long projectDetailId = projectDetail.getId();
|
Long projectDetailId = projectDetail.getId();
|
||||||
@ -106,7 +117,11 @@ public class ProjectDetailController {
|
|||||||
projectCommissionAddRequestList.add(projectCommissionAddRequest);
|
projectCommissionAddRequestList.add(projectCommissionAddRequest);
|
||||||
}
|
}
|
||||||
List<ProjectCommission> projectCommissions = commonService.convertList(projectCommissionAddRequestList, ProjectCommission.class);
|
List<ProjectCommission> projectCommissions = commonService.convertList(projectCommissionAddRequestList, ProjectCommission.class);
|
||||||
projectCommissionService.saveBatch(projectCommissions);
|
List<SubUserProjectCommission> userProjectCommissions = commonService.convertList(projectCommissions, SubUserProjectCommission.class);
|
||||||
|
for (SubUserProjectCommission userProjectCommission : userProjectCommissions) {
|
||||||
|
userProjectCommission.setSubUserId(-1L);
|
||||||
|
}
|
||||||
|
// projectCommissionService.saveBatch(projectCommissions);
|
||||||
|
|
||||||
// 给所有用户添加一条下级项目明细抽佣表
|
// 给所有用户添加一条下级项目明细抽佣表
|
||||||
List<SubUserProjectCommissionAddRequest> subUserProjectCommissionAddRequestList = new ArrayList<>();
|
List<SubUserProjectCommissionAddRequest> subUserProjectCommissionAddRequestList = new ArrayList<>();
|
||||||
@ -122,80 +137,119 @@ public class ProjectDetailController {
|
|||||||
subUserProjectCommissionAddRequestList.add(subUserProjectCommissionAddRequest);
|
subUserProjectCommissionAddRequestList.add(subUserProjectCommissionAddRequest);
|
||||||
}
|
}
|
||||||
List<SubUserProjectCommission> subUserProjectCommissions = commonService.convertList(subUserProjectCommissionAddRequestList, SubUserProjectCommission.class);
|
List<SubUserProjectCommission> subUserProjectCommissions = commonService.convertList(subUserProjectCommissionAddRequestList, SubUserProjectCommission.class);
|
||||||
subUserProjectCommissionService.saveBatch(subUserProjectCommissions);
|
// subUserProjectCommissionService.saveBatch(subUserProjectCommissions);
|
||||||
|
subUserProjectCommissions.addAll(userProjectCommissions);
|
||||||
return ResultUtils.success(true);
|
// 对抽佣记录进行排序
|
||||||
}
|
projectCommissionService.sortSubProjectCommissions(subUserProjectCommissions);
|
||||||
|
// 设置抽佣比例和单价
|
||||||
/**
|
|
||||||
* web端管理员根据id修改项目明细信息
|
|
||||||
* @param projectDetailUpdateRequest 项目明细更新请求体
|
|
||||||
* @return 是否更新成功
|
|
||||||
*/
|
|
||||||
@PostMapping("update")
|
|
||||||
@Operation(summary = "web端管理员更新项目明细", description = "参数:项目明细更新请求体,权限:管理员,方法名:updateProjectDetail")
|
|
||||||
@RequiresPermission(mustRole = UserConstant.ADMIN_ROLE)
|
|
||||||
@SysLog(title = "项目明细管理", content = "web端管理员根据id修改项目明细信息")
|
|
||||||
public BaseResponse<Boolean> updateProjectDetail(@Valid @RequestBody ProjectDetailUpdateRequest projectDetailUpdateRequest) {
|
|
||||||
|
|
||||||
// 更新项目明细的结算价格
|
|
||||||
Long projectDetailId = projectDetailUpdateRequest.getId();
|
|
||||||
ProjectDetail sourceProjectDetail = projectDetailService.getById(projectDetailId);
|
|
||||||
ProjectDetail projectDetail = commonService.copyProperties(projectDetailUpdateRequest, ProjectDetail.class);
|
|
||||||
// 1.更新项目明细的结算价格
|
|
||||||
projectDetailService.updateById(projectDetail);
|
|
||||||
// 更新项目的价格
|
|
||||||
Long projectId = projectDetail.getProjectId();
|
|
||||||
Project project = projectService.getById(projectId);
|
|
||||||
project.setProjectPrice(project.getProjectPrice().subtract(sourceProjectDetail.getProjectSettlementPrice()).add(projectDetail.getProjectSettlementPrice()));
|
|
||||||
projectService.updateById(project);
|
|
||||||
// 2.更新抽佣比例(如果抽佣比例比原来小)
|
|
||||||
List<SubUserProjectCommission> subUserProjectCommissionList = commonService.findByFieldEqTargetField(SubUserProjectCommission::getProjectDetailId, projectDetail.getId(), subUserProjectCommissionService);
|
|
||||||
for (SubUserProjectCommission subUserProjectCommission : subUserProjectCommissionList) {
|
|
||||||
BigDecimal currentCommissionRate = subUserProjectCommission.getCurrentCommissionRate();
|
|
||||||
BigDecimal maxCommissionRate = projectDetail.getMaxCommissionRate();
|
|
||||||
if (currentCommissionRate.compareTo(maxCommissionRate) > 0) subUserProjectCommission.setCurrentCommissionRate(maxCommissionRate);
|
|
||||||
}
|
|
||||||
// 将下级用户项目明细抽佣列表根据父级用户id进行排序(升序)
|
|
||||||
subUserProjectCommissionList.sort(Comparator.comparing(SubUserProjectCommission::getUserId));
|
|
||||||
// 更新下级用户项目明细抽佣表记录
|
|
||||||
BigDecimal projectSettlementPrice = projectDetail.getProjectSettlementPrice();
|
|
||||||
BigDecimal projectMinSettlementPrice = projectDetail.getProjectMinSettlementPrice();
|
|
||||||
// 封装Map集合(键:下级用户id,值:下级用户单价)
|
// 封装Map集合(键:下级用户id,值:下级用户单价)
|
||||||
Map<Long, BigDecimal> subUserUnitPriceMap = new HashMap<>();
|
Map<Long, BigDecimal> subUserProjectCommissionMap = new HashMap<>();
|
||||||
// 获取小程序用户的根用户
|
for (SubUserProjectCommission subUserProjectCommission : subUserProjectCommissions) {
|
||||||
List<UserInfo> userInfoList = commonService.findByFieldEqTargetField(UserInfo::getUserRole, UserConstant.DEFAULT_ROLE, userInfoService);
|
|
||||||
UserInfo rootUserInfo = userInfoList.get(0);
|
|
||||||
// 存储根用户的单价
|
|
||||||
subUserUnitPriceMap.put(rootUserInfo.getId(), projectSettlementPrice);
|
|
||||||
for (SubUserProjectCommission subUserProjectCommission : subUserProjectCommissionList) {
|
|
||||||
// 记录上级用户的对下级用户的抽佣比例
|
|
||||||
BigDecimal currentCommissionRate = subUserProjectCommission.getCurrentCommissionRate();
|
|
||||||
Long userId = subUserProjectCommission.getUserId();
|
Long userId = subUserProjectCommission.getUserId();
|
||||||
Long subUserId = subUserProjectCommission.getSubUserId();
|
Long subUserId = subUserProjectCommission.getSubUserId();
|
||||||
// 获取当前用户的单价,并将当前记录修改为当前用户的单价
|
// 设置抽佣比例
|
||||||
BigDecimal userUnitPrice = subUserUnitPriceMap.get(userId);
|
BigDecimal uniteRate = userCommissionRateMap.get(userId);
|
||||||
subUserProjectCommission.setMyUnitPrice(userUnitPrice);
|
subUserProjectCommission.setCurrentCommissionRate(uniteRate);
|
||||||
// 计算下级用户的单价
|
// 设置单价
|
||||||
BigDecimal subUserUnitPrice = userUnitPrice.multiply(BigDecimal.ONE.subtract(currentCommissionRate));
|
BigDecimal myUnitPrice = subUserProjectCommissionMap.get(userId);
|
||||||
// 如果下级用户的单价小于项目明细最小结算价格,则设置下级用户的单价为项目明细最小结算价格
|
if (myUnitPrice == null) myUnitPrice = subUserProjectCommission.getMyUnitPrice();
|
||||||
if (subUserUnitPrice.compareTo(projectMinSettlementPrice) < 0) subUserUnitPrice = projectMinSettlementPrice;
|
subUserProjectCommission.setMyUnitPrice(myUnitPrice);
|
||||||
// 存储下级用户的单价
|
BigDecimal subUserUnitPrice = projectCommissionService.calculateFinalPrice(myUnitPrice, uniteRate);
|
||||||
subUserUnitPriceMap.put(subUserId, subUserUnitPrice);
|
if (subUserId != -1L) subUserProjectCommissionMap.put(subUserId, subUserUnitPrice);
|
||||||
}
|
}
|
||||||
// 更新下级用户项目明细抽佣表记录
|
|
||||||
subUserProjectCommissionService.updateBatchById(subUserProjectCommissionList);
|
long startTime = System.currentTimeMillis();
|
||||||
// 更新用户项目明细抽佣表记录
|
|
||||||
List<ProjectCommission> projectCommissionList = commonService.findByFieldEqTargetField(ProjectCommission::getProjectDetailId, projectDetail.getId(), projectCommissionService);
|
// 批量更新下级用户项目明细抽佣记录
|
||||||
for (ProjectCommission projectCommission : projectCommissionList) {
|
List<SubUserProjectCommission> subProjectCommissions = subUserProjectCommissions.stream()
|
||||||
Long userId = projectCommission.getUserId();
|
.filter(subUserProjectCommission -> subUserProjectCommission.getSubUserId() != -1L).toList();
|
||||||
BigDecimal userUnitPrice = subUserUnitPriceMap.get(userId);
|
subUserProjectCommissionService.saveBatch(subProjectCommissions);
|
||||||
projectCommission.setMyUnitPrice(userUnitPrice);
|
// 批量更新用户项目明细抽佣记录
|
||||||
}
|
|
||||||
projectCommissionService.updateBatchById(projectCommissionList);
|
List<SubUserProjectCommission> projectCommissionList = subUserProjectCommissions.stream()
|
||||||
|
.filter(subUserProjectCommission -> subUserProjectCommission.getSubUserId() == -1L).toList();
|
||||||
|
List<ProjectCommission> commissionList = commonService.convertList(projectCommissionList, ProjectCommission.class);
|
||||||
|
projectCommissionService.saveBatch(commissionList);
|
||||||
|
|
||||||
|
// 获取结束时间戳
|
||||||
|
long endTime = System.currentTimeMillis();
|
||||||
|
// 计算执行时间
|
||||||
|
long executionTime = endTime - startTime;
|
||||||
|
System.out.println("程序执行时间: " + executionTime + " 毫秒");
|
||||||
|
|
||||||
|
|
||||||
return ResultUtils.success(true);
|
return ResultUtils.success(true);
|
||||||
}
|
}
|
||||||
|
//
|
||||||
|
// /**
|
||||||
|
// * web端管理员根据id修改项目明细信息
|
||||||
|
// * @param projectDetailUpdateRequest 项目明细更新请求体
|
||||||
|
// * @return 是否更新成功
|
||||||
|
// */
|
||||||
|
// @PostMapping("update")
|
||||||
|
// @Operation(summary = "web端管理员更新项目明细", description = "参数:项目明细更新请求体,权限:管理员,方法名:updateProjectDetail")
|
||||||
|
// @RequiresPermission(mustRole = UserConstant.ADMIN_ROLE)
|
||||||
|
// @SysLog(title = "项目明细管理", content = "web端管理员根据id修改项目明细信息")
|
||||||
|
// public BaseResponse<Boolean> updateProjectDetail(@Valid @RequestBody ProjectDetailUpdateRequest projectDetailUpdateRequest) {
|
||||||
|
//
|
||||||
|
// // 更新项目明细的结算价格
|
||||||
|
// Long projectDetailId = projectDetailUpdateRequest.getId();
|
||||||
|
// ProjectDetail sourceProjectDetail = projectDetailService.getById(projectDetailId);
|
||||||
|
// ProjectDetail projectDetail = commonService.copyProperties(projectDetailUpdateRequest, ProjectDetail.class);
|
||||||
|
// // 1.更新项目明细的结算价格
|
||||||
|
// projectDetailService.updateById(projectDetail);
|
||||||
|
// // 更新项目的价格
|
||||||
|
// Long projectId = projectDetail.getProjectId();
|
||||||
|
// Project project = projectService.getById(projectId);
|
||||||
|
// project.setProjectPrice(project.getProjectPrice().subtract(sourceProjectDetail.getProjectSettlementPrice()).add(projectDetail.getProjectSettlementPrice()));
|
||||||
|
// projectService.updateById(project);
|
||||||
|
// // 2.更新抽佣比例(如果抽佣比例比原来小)
|
||||||
|
// List<SubUserProjectCommission> subUserProjectCommissionList = commonService.findByFieldEqTargetField(SubUserProjectCommission::getProjectDetailId, projectDetail.getId(), subUserProjectCommissionService);
|
||||||
|
// for (SubUserProjectCommission subUserProjectCommission : subUserProjectCommissionList) {
|
||||||
|
// BigDecimal currentCommissionRate = subUserProjectCommission.getCurrentCommissionRate();
|
||||||
|
// BigDecimal maxCommissionRate = projectDetail.getMaxCommissionRate();
|
||||||
|
// if (currentCommissionRate.compareTo(maxCommissionRate) > 0) subUserProjectCommission.setCurrentCommissionRate(maxCommissionRate);
|
||||||
|
// }
|
||||||
|
// // 将下级用户项目明细抽佣列表根据父级用户id进行排序(升序)
|
||||||
|
// subUserProjectCommissionList.sort(Comparator.comparing(SubUserProjectCommission::getUserId));
|
||||||
|
// // 更新下级用户项目明细抽佣表记录
|
||||||
|
// BigDecimal projectSettlementPrice = projectDetail.getProjectSettlementPrice();
|
||||||
|
// BigDecimal projectMinSettlementPrice = projectDetail.getProjectMinSettlementPrice();
|
||||||
|
// // 封装Map集合(键:下级用户id,值:下级用户单价)
|
||||||
|
// Map<Long, BigDecimal> subUserUnitPriceMap = new HashMap<>();
|
||||||
|
// // 获取小程序用户的根用户
|
||||||
|
// List<UserInfo> userInfoList = commonService.findByFieldEqTargetField(UserInfo::getUserRole, UserConstant.DEFAULT_ROLE, userInfoService);
|
||||||
|
// UserInfo rootUserInfo = userInfoList.get(0);
|
||||||
|
// // 存储根用户的单价
|
||||||
|
// subUserUnitPriceMap.put(rootUserInfo.getId(), projectSettlementPrice);
|
||||||
|
// for (SubUserProjectCommission subUserProjectCommission : subUserProjectCommissionList) {
|
||||||
|
// // 记录上级用户的对下级用户的抽佣比例
|
||||||
|
// BigDecimal currentCommissionRate = subUserProjectCommission.getCurrentCommissionRate();
|
||||||
|
// Long userId = subUserProjectCommission.getUserId();
|
||||||
|
// Long subUserId = subUserProjectCommission.getSubUserId();
|
||||||
|
// // 获取当前用户的单价,并将当前记录修改为当前用户的单价
|
||||||
|
// BigDecimal userUnitPrice = subUserUnitPriceMap.get(userId);
|
||||||
|
// subUserProjectCommission.setMyUnitPrice(userUnitPrice);
|
||||||
|
// // 计算下级用户的单价
|
||||||
|
// BigDecimal subUserUnitPrice = userUnitPrice.multiply(BigDecimal.ONE.subtract(currentCommissionRate));
|
||||||
|
// // 如果下级用户的单价小于项目明细最小结算价格,则设置下级用户的单价为项目明细最小结算价格
|
||||||
|
// if (subUserUnitPrice.compareTo(projectMinSettlementPrice) < 0) subUserUnitPrice = projectMinSettlementPrice;
|
||||||
|
// // 存储下级用户的单价
|
||||||
|
// subUserUnitPriceMap.put(subUserId, subUserUnitPrice);
|
||||||
|
// }
|
||||||
|
// // 更新下级用户项目明细抽佣表记录
|
||||||
|
// subUserProjectCommissionService.updateBatchById(subUserProjectCommissionList);
|
||||||
|
// // 更新用户项目明细抽佣表记录
|
||||||
|
// List<ProjectCommission> projectCommissionList = commonService.findByFieldEqTargetField(ProjectCommission::getProjectDetailId, projectDetail.getId(), projectCommissionService);
|
||||||
|
// for (ProjectCommission projectCommission : projectCommissionList) {
|
||||||
|
// Long userId = projectCommission.getUserId();
|
||||||
|
// BigDecimal userUnitPrice = subUserUnitPriceMap.get(userId);
|
||||||
|
// projectCommission.setMyUnitPrice(userUnitPrice);
|
||||||
|
// }
|
||||||
|
// projectCommissionService.updateBatchById(projectCommissionList);
|
||||||
|
//
|
||||||
|
// return ResultUtils.success(true);
|
||||||
|
// }
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* web端管理员根据id删除项目明细
|
* web端管理员根据id删除项目明细
|
||||||
|
@ -9,6 +9,7 @@ import com.greenorange.promotion.common.BaseResponse;
|
|||||||
import com.greenorange.promotion.common.ErrorCode;
|
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.BusinessException;
|
||||||
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.CommonBatchRequest;
|
||||||
import com.greenorange.promotion.model.dto.promoCodeApply.PromoCodeApplyAddRequest;
|
import com.greenorange.promotion.model.dto.promoCodeApply.PromoCodeApplyAddRequest;
|
||||||
@ -82,6 +83,12 @@ public class PromoCodeApplyController {
|
|||||||
Long userId = (Long) request.getAttribute("userId");
|
Long userId = (Long) request.getAttribute("userId");
|
||||||
// 取出当前项目的推广码
|
// 取出当前项目的推广码
|
||||||
Long projectId = promoCodeApplyRequest.getProjectId();
|
Long projectId = promoCodeApplyRequest.getProjectId();
|
||||||
|
//项目状态如果不是运行中的话无法申请推广码
|
||||||
|
LambdaQueryWrapper<Project> projectLambdaQueryWrapper = new LambdaQueryWrapper<>();
|
||||||
|
projectLambdaQueryWrapper.eq(Project::getId, projectId);
|
||||||
|
Project project2 = projectService.getOne(projectLambdaQueryWrapper);
|
||||||
|
String projectStatus = project2.getProjectStatus();
|
||||||
|
if(!projectStatus.equals("running")) throw new BusinessException(ErrorCode.OPERATION_ERROR,"该项目未处于运行状态,无法申请推广码");
|
||||||
String phoneNumber = promoCodeApplyRequest.getSalespersonPhone();
|
String phoneNumber = promoCodeApplyRequest.getSalespersonPhone();
|
||||||
// 判断是否重复绑定了手机号
|
// 判断是否重复绑定了手机号
|
||||||
Map<SFunction<PromoCodeApply, ?>, Object> applyConditions = Map.of(PromoCodeApply::getUserId, userId, PromoCodeApply::getProjectId, projectId, PromoCodeApply::getSalespersonPhone, phoneNumber);
|
Map<SFunction<PromoCodeApply, ?>, Object> applyConditions = Map.of(PromoCodeApply::getUserId, userId, PromoCodeApply::getProjectId, projectId, PromoCodeApply::getSalespersonPhone, phoneNumber);
|
||||||
@ -100,6 +107,9 @@ public class PromoCodeApplyController {
|
|||||||
String promoCodeImage = promoCode.getPromoCodeImage();
|
String promoCodeImage = promoCode.getPromoCodeImage();
|
||||||
// 获取项目的参数信息
|
// 获取项目的参数信息
|
||||||
Project project = projectService.getById(projectId);
|
Project project = projectService.getById(projectId);
|
||||||
|
// 检查项目是否处于运行中
|
||||||
|
// String projectStatus = project.getProjectStatus();
|
||||||
|
// ThrowUtils.throwIf(!projectStatus.equals("running"), ErrorCode.OPERATION_ERROR, "该项目未处于运行状态,无法申请推广码");
|
||||||
|
|
||||||
// 更新项目的推广人数
|
// 更新项目的推广人数
|
||||||
Map<SFunction<UserProject, ?>, Object> projectConditions = Map.of(UserProject::getProjectId, projectId, UserProject::getUserId, userId);
|
Map<SFunction<UserProject, ?>, Object> projectConditions = Map.of(UserProject::getProjectId, projectId, UserProject::getUserId, userId);
|
||||||
@ -110,6 +120,8 @@ public class PromoCodeApplyController {
|
|||||||
String projectName = project.getProjectName();
|
String projectName = project.getProjectName();
|
||||||
String projectImage = project.getProjectImage();
|
String projectImage = project.getProjectImage();
|
||||||
Integer projectSettlementCycle = project.getProjectSettlementCycle();
|
Integer projectSettlementCycle = project.getProjectSettlementCycle();
|
||||||
|
//判断项目推广人数是否满了
|
||||||
|
|
||||||
// 获取业务员信息
|
// 获取业务员信息
|
||||||
String salespersonName = promoCodeApplyRequest.getSalespersonName();
|
String salespersonName = promoCodeApplyRequest.getSalespersonName();
|
||||||
String salespersonPhone = promoCodeApplyRequest.getSalespersonPhone();
|
String salespersonPhone = promoCodeApplyRequest.getSalespersonPhone();
|
||||||
|
@ -114,12 +114,7 @@ public class PromoCodeController {
|
|||||||
@RequiresPermission(mustRole = UserConstant.ADMIN_ROLE)
|
@RequiresPermission(mustRole = UserConstant.ADMIN_ROLE)
|
||||||
@SysLog(title = "推广码管理", content = "web端管理员批量删除推广码")
|
@SysLog(title = "推广码管理", content = "web端管理员批量删除推广码")
|
||||||
public BaseResponse<Boolean> delBatchPromoCode(@Valid @RequestBody CommonBatchRequest commonBatchRequest) {
|
public BaseResponse<Boolean> delBatchPromoCode(@Valid @RequestBody CommonBatchRequest commonBatchRequest) {
|
||||||
List<Long> ids = commonBatchRequest.getIds();
|
promoCodeService.delBatchPromoCode(commonBatchRequest);
|
||||||
LambdaQueryWrapper<PromoCode> lambdaQueryWrapper = new LambdaQueryWrapper<>();
|
|
||||||
lambdaQueryWrapper.in(PromoCode::getId, ids).eq(PromoCode::getPromoCodeStatus, true);
|
|
||||||
List<PromoCode> promoCodeList = promoCodeService.list(lambdaQueryWrapper);
|
|
||||||
ThrowUtils.throwIf(promoCodeList.size() > 0, ErrorCode.OPERATION_ERROR, "当前推广码正在使用中,无法删除");
|
|
||||||
promoCodeService.removeByIds(ids);
|
|
||||||
return ResultUtils.success(true);
|
return ResultUtils.success(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -0,0 +1,17 @@
|
|||||||
|
package com.greenorange.promotion.controller.projectSettlement;
|
||||||
|
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
|
||||||
|
@NoArgsConstructor
|
||||||
|
|
||||||
|
@AllArgsConstructor
|
||||||
|
public class Addqurrywithdraw {
|
||||||
|
private Long userid;
|
||||||
|
private BigDecimal payouts;
|
||||||
|
}
|
@ -75,6 +75,7 @@ public class ProjectSettlementController {
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 小程序端用户根据推广码申请记录id查询结算记录
|
* 小程序端用户根据推广码申请记录id查询结算记录
|
||||||
* @param commonRequest 项目结算记录添加请求体
|
* @param commonRequest 项目结算记录添加请求体
|
||||||
|
@ -5,25 +5,32 @@ 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.BusinessException;
|
||||||
|
import com.greenorange.promotion.exception.ThrowUtils;
|
||||||
|
import com.greenorange.promotion.model.dto.userAccount.UserAccountQueryRequest;
|
||||||
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.entity.FundsChange;
|
import com.greenorange.promotion.model.entity.*;
|
||||||
import com.greenorange.promotion.model.entity.UserMainInfo;
|
|
||||||
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.fundsChange.FundsItemVO;
|
import com.greenorange.promotion.model.vo.fundsChange.FundsItemVO;
|
||||||
|
import com.greenorange.promotion.model.vo.userAccount.UserAccountConditionVO;
|
||||||
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.UserAccountService;
|
||||||
import com.greenorange.promotion.service.settle.WithdrawalApplyService;
|
import com.greenorange.promotion.service.settle.WithdrawalApplyService;
|
||||||
|
import com.greenorange.promotion.service.userInfo.UserInfoService;
|
||||||
import com.greenorange.promotion.service.userInfo.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.Priority;
|
||||||
import jakarta.annotation.Resource;
|
import jakarta.annotation.Resource;
|
||||||
import jakarta.servlet.http.HttpServletRequest;
|
import jakarta.servlet.http.HttpServletRequest;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.springframework.beans.BeanUtils;
|
||||||
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;
|
||||||
@ -32,6 +39,7 @@ import org.springframework.web.bind.annotation.RequestMapping;
|
|||||||
import org.springframework.web.bind.annotation.RestController;
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
|
|
||||||
import java.math.BigDecimal;
|
import java.math.BigDecimal;
|
||||||
|
import java.util.Collections;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
|
|
||||||
@ -43,99 +51,46 @@ import java.util.List;
|
|||||||
@Slf4j
|
@Slf4j
|
||||||
@Tag(name = "提现申请记录管理")
|
@Tag(name = "提现申请记录管理")
|
||||||
public class WithdrawalApplyController {
|
public class WithdrawalApplyController {
|
||||||
|
@Resource
|
||||||
|
private UserAccountService userAccountService;
|
||||||
|
@Resource
|
||||||
|
private UserMainInfoService userMainInfoService;
|
||||||
@Resource
|
@Resource
|
||||||
private WithdrawalApplyService withdrawalApplyService;
|
private WithdrawalApplyService withdrawalApplyService;
|
||||||
|
|
||||||
@Resource
|
@Resource
|
||||||
private FundsChangeService fundsChangeService;
|
private FundsChangeService fundsChangeService;
|
||||||
|
|
||||||
@Resource
|
@PostMapping("addqurry")
|
||||||
private CommonService commonService;
|
public BaseResponse<String> addqurry(@RequestBody Addqurrywithdraw addqurrywithdraw ){
|
||||||
|
Long userid = addqurrywithdraw.getUserid();
|
||||||
@Resource
|
BigDecimal payouts = addqurrywithdraw.getPayouts();
|
||||||
private UserMainInfoService userMainInfoService;
|
LambdaQueryWrapper<UserMainInfo> queryWrapper = new LambdaQueryWrapper<>();
|
||||||
|
queryWrapper.eq(UserMainInfo::getUserId, userid);
|
||||||
|
UserMainInfo one = userMainInfoService.getOne(queryWrapper);
|
||||||
/**
|
BigDecimal currentBalance = one.getCurrentBalance();
|
||||||
* 小程序端用户申请提现
|
if(payouts.compareTo(currentBalance) > 0) throw new BusinessException(ErrorCode.OPERATION_ERROR,"提现金额超过当前的余额");
|
||||||
* @param withdrawalApplyAddRequest 提现申请记录查添加请求体
|
LambdaQueryWrapper<UserAccount> queryWrapper2 = new LambdaQueryWrapper<>();
|
||||||
* @return 提现申请记录id
|
queryWrapper2.eq(UserAccount::getUserId, userid);
|
||||||
*/
|
UserAccount two = userAccountService.getOne(queryWrapper2);
|
||||||
@PostMapping("add")
|
WithdrawalApply withdrawalApply = new WithdrawalApply();
|
||||||
@Operation(summary = "小程序端用户申请提现", description = "参数:提现申请记录查添加请求体,权限:管理员,方法名:addWithdrawalApply")
|
BeanUtils.copyProperties(two, withdrawalApply);
|
||||||
@RequiresPermission(mustRole = UserConstant.DEFAULT_ROLE)
|
withdrawalApply.setId(null);
|
||||||
// @SysLog(title = "提现申请记录管理", content = "小程序端用户申请提现")
|
withdrawalApply.setUpdateTime(null);
|
||||||
public BaseResponse<Long> addWithdrawalApply(@Valid @RequestBody WithdrawalApplyAddRequest withdrawalApplyAddRequest, HttpServletRequest request) {
|
withdrawalApply.setCreateTime(null);
|
||||||
Long userId = (Long) request.getAttribute("userId");
|
withdrawalApply.setWithdrawnAmount(payouts);
|
||||||
BigDecimal withdrawnAmount = withdrawalApplyAddRequest.getWithdrawnAmount();
|
withdrawalApply.setWithdrawalStatus("processing");
|
||||||
WithdrawalApply withdrawalApply = WithdrawalApply.builder()
|
|
||||||
.withdrawnAmount(withdrawnAmount)
|
|
||||||
.userId(userId)
|
|
||||||
.build();
|
|
||||||
withdrawalApplyService.save(withdrawalApply);
|
withdrawalApplyService.save(withdrawalApply);
|
||||||
return ResultUtils.success(withdrawalApply.getId());
|
BigDecimal subtract = currentBalance.subtract(payouts);
|
||||||
|
one.setCurrentBalance(subtract);
|
||||||
|
userMainInfoService.updateById(one);
|
||||||
|
FundsChange fundsChange = new FundsChange();
|
||||||
|
fundsChange.setUserId(userid);
|
||||||
|
fundsChange.setChangeAmount(payouts);
|
||||||
|
fundsChange.setProjectName("processing");
|
||||||
|
fundsChange.setCurrentAmount(subtract);
|
||||||
|
fundsChange.setProjectSettlementId(0L);
|
||||||
|
fundsChangeService.save(fundsChange);
|
||||||
|
return ResultUtils.success("提现成功");
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 小程序端用户查询提现申请记录
|
|
||||||
* @return 提现申请记录列表
|
|
||||||
*/
|
|
||||||
@PostMapping("query")
|
|
||||||
@Operation(summary = "小程序端用户查询提现申请记录", description = "参数:无,权限:管理员,方法名:queryWithdrawalApplyByUserId")
|
|
||||||
@RequiresPermission(mustRole = UserConstant.DEFAULT_ROLE)
|
|
||||||
// @SysLog(title = "提现申请记录管理", content = "小程序端用户查询提现申请记录")
|
|
||||||
public BaseResponse<List<WithdrawalApplyVO>> queryWithdrawalApplyByUserId(HttpServletRequest request) {
|
|
||||||
Long userId = (Long) request.getAttribute("userId");
|
|
||||||
List<WithdrawalApply> withdrawalApplyList = commonService.findByFieldEqTargetField(WithdrawalApply::getUserId, userId, withdrawalApplyService);
|
|
||||||
List<WithdrawalApplyVO> withdrawalApplyVOS = commonService.convertList(withdrawalApplyList, WithdrawalApplyVO.class);
|
|
||||||
return ResultUtils.success(withdrawalApplyVOS);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 小程序端用户查询资金变动记录
|
|
||||||
* @return 提现申请记录id
|
|
||||||
*/
|
|
||||||
@PostMapping("query/change")
|
|
||||||
@Operation(summary = "小程序端用户查询资金变动记录", description = "参数:无,权限:管理员,方法名:queryFundsChangeByUserId")
|
|
||||||
@RequiresPermission(mustRole = UserConstant.DEFAULT_ROLE)
|
|
||||||
// @SysLog(title = "提现申请记录管理", content = "小程序端用户查询资金变动记录")
|
|
||||||
public BaseResponse<FundsItemVO> queryFundsChangeByUserId(HttpServletRequest request) {
|
|
||||||
Long userId = (Long) request.getAttribute("userId");
|
|
||||||
LambdaQueryWrapper<UserMainInfo> lambdaQueryWrapper = new LambdaQueryWrapper<>();
|
|
||||||
lambdaQueryWrapper.eq(UserMainInfo::getUserId, userId);
|
|
||||||
UserMainInfo userMainInfo = userMainInfoService.getOne(lambdaQueryWrapper);
|
|
||||||
FundsItemVO fundsItemVO = commonService.copyProperties(userMainInfo, FundsItemVO.class);
|
|
||||||
List<FundsChange> fundsChangeList = commonService.findByFieldEqTargetField(FundsChange::getUserId, userId, fundsChangeService);
|
|
||||||
List<FundsChangeVO> fundsChangeVOS = commonService.convertList(fundsChangeList, FundsChangeVO.class);
|
|
||||||
fundsItemVO.setFundsChangeVOList(fundsChangeVOS);
|
|
||||||
return ResultUtils.success(fundsItemVO);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Web端管理员分页查询提现申请记录
|
|
||||||
* @param withdrawalApplyQueryRequest 提现申请记录查询请求体
|
|
||||||
* @return 提现申请记录列表
|
|
||||||
*/
|
|
||||||
@PostMapping("page")
|
|
||||||
@Operation(summary = "Web端管理员分页查询提现申请记录", description = "参数:提现申请记录查询请求体,权限:管理员,方法名:listWithdrawalApplyByPage")
|
|
||||||
@RequiresPermission(mustRole = UserConstant.ADMIN_ROLE)
|
|
||||||
@SysLog(title = "提现申请记录管理", content = "Web端管理员分页查询提现申请记录")
|
|
||||||
public BaseResponse<Page<WithdrawalApplyVO>> listWithdrawalApplyByPage(@Valid @RequestBody WithdrawalApplyQueryRequest withdrawalApplyQueryRequest) {
|
|
||||||
long current = withdrawalApplyQueryRequest.getCurrent();
|
|
||||||
long pageSize = withdrawalApplyQueryRequest.getPageSize();
|
|
||||||
QueryWrapper<WithdrawalApply> queryWrapper = withdrawalApplyService.getQueryWrapper(withdrawalApplyQueryRequest);
|
|
||||||
Page<WithdrawalApply> page = withdrawalApplyService.page(new Page<>(current, pageSize), queryWrapper);
|
|
||||||
List<WithdrawalApply> withdrawalApplyList = page.getRecords();
|
|
||||||
List<WithdrawalApplyVO> withdrawalApplyVOList = commonService.convertList(withdrawalApplyList, WithdrawalApplyVO.class);
|
|
||||||
Page<WithdrawalApplyVO> voPage = new Page<>(current, pageSize);
|
|
||||||
voPage.setRecords(withdrawalApplyVOList);
|
|
||||||
voPage.setPages(page.getPages());
|
|
||||||
voPage.setTotal(page.getTotal());
|
|
||||||
return ResultUtils.success(voPage);
|
|
||||||
}
|
|
||||||
}
|
|
@ -58,10 +58,7 @@ public class UserAccountController {
|
|||||||
@RequiresPermission(mustRole = UserConstant.DEFAULT_ROLE)
|
@RequiresPermission(mustRole = UserConstant.DEFAULT_ROLE)
|
||||||
// @SysLog(title = "用户账户管理", content = "小程序端用户添加用户账户")
|
// @SysLog(title = "用户账户管理", content = "小程序端用户添加用户账户")
|
||||||
public BaseResponse<Boolean> addUserAccount(@Valid @RequestBody UserAccountAddRequest userAccountAddRequest, HttpServletRequest request) {
|
public BaseResponse<Boolean> addUserAccount(@Valid @RequestBody UserAccountAddRequest userAccountAddRequest, HttpServletRequest request) {
|
||||||
Long userId = (Long) request.getAttribute("userId");
|
userAccountService.addUserAccount(userAccountAddRequest, request);
|
||||||
UserAccount userAccount = commonService.copyProperties(userAccountAddRequest, UserAccount.class);
|
|
||||||
userAccount.setUserId(userId);
|
|
||||||
userAccountService.save(userAccount);
|
|
||||||
return ResultUtils.success(true);
|
return ResultUtils.success(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -75,10 +72,7 @@ public class UserAccountController {
|
|||||||
@RequiresPermission(mustRole = UserConstant.DEFAULT_ROLE)
|
@RequiresPermission(mustRole = UserConstant.DEFAULT_ROLE)
|
||||||
// @SysLog(title = "用户账户管理", content = "小程序端用户根据id修改用户账户信息")
|
// @SysLog(title = "用户账户管理", content = "小程序端用户根据id修改用户账户信息")
|
||||||
public BaseResponse<Boolean> updateUserAccount(@Valid @RequestBody UserAccountUpdateRequest userAccountUpdateRequest, HttpServletRequest request) {
|
public BaseResponse<Boolean> updateUserAccount(@Valid @RequestBody UserAccountUpdateRequest userAccountUpdateRequest, HttpServletRequest request) {
|
||||||
Long userId = (Long) request.getAttribute("userId");
|
userAccountService.updateUserAccount(userAccountUpdateRequest, request);
|
||||||
UserAccount userAccount = commonService.copyProperties(userAccountUpdateRequest, UserAccount.class);
|
|
||||||
userAccount.setUserId(userId);
|
|
||||||
userAccountService.updateById(userAccount);
|
|
||||||
return ResultUtils.success(true);
|
return ResultUtils.success(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -10,6 +10,7 @@ import com.greenorange.promotion.common.BaseResponse;
|
|||||||
import com.greenorange.promotion.common.ErrorCode;
|
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.BusinessException;
|
||||||
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.CommonBatchRequest;
|
||||||
import com.greenorange.promotion.model.dto.CommonRequest;
|
import com.greenorange.promotion.model.dto.CommonRequest;
|
||||||
@ -17,6 +18,7 @@ import com.greenorange.promotion.model.dto.CommonStringRequest;
|
|||||||
import com.greenorange.promotion.model.dto.userInfo.*;
|
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.userInfo.SuperUserInfoVO;
|
||||||
import com.greenorange.promotion.model.vo.userInfo.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;
|
||||||
@ -29,6 +31,7 @@ import jakarta.annotation.Resource;
|
|||||||
import jakarta.servlet.http.HttpServletRequest;
|
import jakarta.servlet.http.HttpServletRequest;
|
||||||
import jakarta.validation.Valid;
|
import jakarta.validation.Valid;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.apache.ibatis.io.JBoss6VFS;
|
||||||
import org.springframework.data.redis.core.RedisTemplate;
|
import org.springframework.data.redis.core.RedisTemplate;
|
||||||
import org.springframework.web.bind.annotation.*;
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
@ -302,6 +305,14 @@ public class UserInfoController {
|
|||||||
@RequiresPermission(mustRole = UserConstant.BOSS_ROLE)
|
@RequiresPermission(mustRole = UserConstant.BOSS_ROLE)
|
||||||
@SysLog(title = "用户管理", content = "web端管理员添加用户")
|
@SysLog(title = "用户管理", content = "web端管理员添加用户")
|
||||||
public BaseResponse<Boolean> addUserInfo(@Valid @RequestBody UserInfoAddRequest userInfoAddRequest) {
|
public BaseResponse<Boolean> addUserInfo(@Valid @RequestBody UserInfoAddRequest userInfoAddRequest) {
|
||||||
|
String userAccount = userInfoAddRequest.getUserAccount();
|
||||||
|
String userPassword = userInfoAddRequest.getUserPassword();
|
||||||
|
LambdaQueryWrapper<UserInfo> queryWrapper = new LambdaQueryWrapper<>();
|
||||||
|
queryWrapper.eq(UserInfo::getUserRole,"boss");
|
||||||
|
UserInfo one = userInfoService.getOne(queryWrapper);
|
||||||
|
String userAccount2 = one.getUserAccount();
|
||||||
|
String userPassword2 = one.getUserPassword();
|
||||||
|
if(userAccount2.equals(userAccount) && userPassword2.equals(userPassword)) throw new BusinessException(ErrorCode.OPERATION_ERROR,"不能添加跟boss重名的账号和密码");
|
||||||
UserInfo userInfo = commonService.copyProperties(userInfoAddRequest, UserInfo.class);
|
UserInfo userInfo = commonService.copyProperties(userInfoAddRequest, UserInfo.class);
|
||||||
userInfo.setParentUserId(-1L);
|
userInfo.setParentUserId(-1L);
|
||||||
userInfo.setUserRole(UserConstant.ADMIN_ROLE);
|
userInfo.setUserRole(UserConstant.ADMIN_ROLE);
|
||||||
@ -406,6 +417,8 @@ public class UserInfoController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// /**
|
// /**
|
||||||
// * (小程序端)查询当前用户到根节点的userId路径
|
// * (小程序端)查询当前用户到根节点的userId路径
|
||||||
// * @param commonRequest 用户id
|
// * @param commonRequest 用户id
|
||||||
@ -423,6 +436,23 @@ public class UserInfoController {
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 小程序端用户获取上级用户信息
|
||||||
|
* @return 上级用户信息
|
||||||
|
*/
|
||||||
|
@PostMapping("getSuper")
|
||||||
|
@Operation(summary = "小程序端用户获取上级用户信息", description = "参数:用户表查询请求体,权限:管理员(boss, admin),方法名:queryUserInfoById")
|
||||||
|
@RequiresPermission(mustRole = UserConstant.DEFAULT_ROLE)
|
||||||
|
public BaseResponse<SuperUserInfoVO> getSuperUserInfo(HttpServletRequest request) {
|
||||||
|
Long userId = (Long) request.getAttribute("userId");
|
||||||
|
UserInfo userInfo = userInfoService.getById(userId);
|
||||||
|
Long parentUserId = userInfo.getParentUserId();
|
||||||
|
if (parentUserId != 0) {
|
||||||
|
userInfo = userInfoService.getById(parentUserId);
|
||||||
|
}
|
||||||
|
SuperUserInfoVO superUserInfoVO = commonService.copyProperties(userInfo, SuperUserInfoVO.class);
|
||||||
|
return ResultUtils.success(superUserInfoVO);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -1,17 +1,12 @@
|
|||||||
package com.greenorange.promotion.controller.wechat;
|
package com.greenorange.promotion.controller.wechat;
|
||||||
|
|
||||||
|
|
||||||
import cn.hutool.http.HttpUtil;
|
|
||||||
import cn.hutool.json.JSONUtil;
|
|
||||||
import com.greenorange.promotion.annotation.RequiresPermission;
|
|
||||||
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.config.WxAccessToken;
|
import com.greenorange.promotion.config.WxAccessToken;
|
||||||
import com.greenorange.promotion.constant.UserConstant;
|
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.service.wechat.WechatGetQrcodeService;
|
import com.greenorange.promotion.service.wechat.WechatGetQrcodeService;
|
||||||
import com.greenorange.promotion.utils.QRCodeUtil;
|
|
||||||
import io.swagger.v3.oas.annotations.Hidden;
|
import io.swagger.v3.oas.annotations.Hidden;
|
||||||
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;
|
||||||
@ -22,15 +17,7 @@ import lombok.extern.slf4j.Slf4j;
|
|||||||
import org.springframework.data.redis.core.RedisTemplate;
|
import org.springframework.data.redis.core.RedisTemplate;
|
||||||
import org.springframework.web.bind.annotation.*;
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
import javax.imageio.ImageIO;
|
import java.io.*;
|
||||||
import java.awt.image.BufferedImage;
|
|
||||||
import java.io.ByteArrayInputStream;
|
|
||||||
import java.io.FileOutputStream;
|
|
||||||
import java.io.IOException;
|
|
||||||
import java.io.InputStream;
|
|
||||||
import java.util.Base64;
|
|
||||||
import java.util.HashMap;
|
|
||||||
import java.util.Map;
|
|
||||||
|
|
||||||
|
|
||||||
@Slf4j
|
@Slf4j
|
||||||
@ -78,6 +65,24 @@ public class WechatGetQrcodeController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 微信小程序获取课程码
|
||||||
|
* @return
|
||||||
|
* @throws IOException
|
||||||
|
*/
|
||||||
|
@Hidden
|
||||||
|
@PostMapping("/get/course/qrcode")
|
||||||
|
@Operation(summary = "微信小程序获取课程码", description = "参数:无, 权限:所有人, 方法名:getCourseQrcode")
|
||||||
|
// @RequiresPermission(mustRole = UserConstant.DEFAULT_ROLE)
|
||||||
|
public BaseResponse<String> getCourseQrcode(@Valid @RequestBody CommonRequest commonRequest, HttpServletRequest request) throws Exception {
|
||||||
|
String view = wechatGetQrcodeService.getWxCourseQrCode(commonRequest, request);
|
||||||
|
return ResultUtils.success(view);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -50,16 +50,25 @@ public class GlobalExceptionHandler {
|
|||||||
// 处理参数绑定失败的异常
|
// 处理参数绑定失败的异常
|
||||||
@ExceptionHandler(MethodArgumentNotValidException.class)
|
@ExceptionHandler(MethodArgumentNotValidException.class)
|
||||||
public BaseResponse<?> handleMethodArgumentNotValidException(MethodArgumentNotValidException e) {
|
public BaseResponse<?> handleMethodArgumentNotValidException(MethodArgumentNotValidException e) {
|
||||||
StringBuilder errors = new StringBuilder();
|
// StringBuilder errors = new StringBuilder();
|
||||||
// 按字段名排序,确保每次返回的顺序一致
|
// // 按字段名排序,确保每次返回的顺序一致
|
||||||
e.getBindingResult().getFieldErrors().stream()
|
// e.getBindingResult().getFieldErrors().stream()
|
||||||
.sorted(Comparator.comparing(FieldError::getField)) // 按字段名排序
|
// .sorted(Comparator.comparing(FieldError::getField)) // 按字段名排序
|
||||||
.forEach(fieldError -> errors.append("参数: ")
|
// .forEach(fieldError -> errors.append("参数: ")
|
||||||
.append(fieldError.getField())
|
// .append(fieldError.getField())
|
||||||
.append(" | 错误: ")
|
// .append(" | 错误: ")
|
||||||
.append(fieldError.getDefaultMessage())
|
// .append(fieldError.getDefaultMessage())
|
||||||
.append("; "));
|
// .append("; "));
|
||||||
return ResultUtils.error(ErrorCode.PARAMS_ERROR, errors.toString());
|
// return ResultUtils.error(ErrorCode.PARAMS_ERROR, errors.toString());
|
||||||
|
|
||||||
|
// 按字段名排序,取第一个错误的 defaultMessage
|
||||||
|
String msg = e.getBindingResult()
|
||||||
|
.getFieldErrors().stream()
|
||||||
|
.sorted(Comparator.comparing(FieldError::getField))
|
||||||
|
.map(FieldError::getDefaultMessage)
|
||||||
|
.findFirst()
|
||||||
|
.orElse("参数校验失败");
|
||||||
|
return ResultUtils.error(ErrorCode.PARAMS_ERROR, msg);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -15,9 +15,9 @@ import java.util.*;
|
|||||||
public class Generator {
|
public class Generator {
|
||||||
|
|
||||||
// 数据源配置
|
// 数据源配置
|
||||||
private static final String DATASOURCE_URL = "jdbc:mysql://1.94.237.210:3306/qingcheng?serverTimezone=Asia/Shanghai";
|
private static final String DATASOURCE_URL = "jdbc:mysql://27.30.77.229:3306/qingcheng_dev?serverTimezone=Asia/Shanghai";
|
||||||
private static final String USERNAME = "qingcheng";
|
private static final String USERNAME = "qingcheng";
|
||||||
private static final String PASSWORD = "Qc@123456";
|
private static final String PASSWORD = "Qc@8ls2jf";
|
||||||
|
|
||||||
// 输出路径
|
// 输出路径
|
||||||
private static final String OUTPUT_PATH = System.getProperty("user.dir");
|
private static final String OUTPUT_PATH = System.getProperty("user.dir");
|
||||||
@ -27,13 +27,13 @@ public class Generator {
|
|||||||
// 作者
|
// 作者
|
||||||
private static final String AUTHOR = "chenxinzhi";
|
private static final String AUTHOR = "chenxinzhi";
|
||||||
// 表注释
|
// 表注释
|
||||||
private static final String TABLE_COMMENT = "用户账户";
|
private static final String TABLE_COMMENT = "课程订单";
|
||||||
// 实体类名
|
// 实体类名
|
||||||
private static final String ENTITY_NAME = "UserAccount";
|
private static final String ENTITY_NAME = "CourseOrder";
|
||||||
// 表名
|
// 表名
|
||||||
private static final String TABLE_NAME = "user_account";
|
private static final String TABLE_NAME = "course_order";
|
||||||
// 实体类属性名
|
// 实体类属性名
|
||||||
private static final String ENTITY_NAME_LOWER = "userAccount";
|
private static final String ENTITY_NAME_LOWER = "courseOrder";
|
||||||
|
|
||||||
// 父包名
|
// 父包名
|
||||||
private static final String PARENT_PATH = "com.greenorange.promotion";
|
private static final String PARENT_PATH = "com.greenorange.promotion";
|
||||||
|
@ -0,0 +1,18 @@
|
|||||||
|
package com.greenorange.promotion.mapper;
|
||||||
|
|
||||||
|
import com.greenorange.promotion.model.entity.CourseChapter;
|
||||||
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author 35880
|
||||||
|
* @description 针对表【course_chapter(课程章节表)】的数据库操作Mapper
|
||||||
|
* @createDate 2025-06-23 18:30:28
|
||||||
|
* @Entity com.greenorange.promotion.model.entity.CourseChapter
|
||||||
|
*/
|
||||||
|
public interface CourseChapterMapper extends BaseMapper<CourseChapter> {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -0,0 +1,18 @@
|
|||||||
|
package com.greenorange.promotion.mapper;
|
||||||
|
|
||||||
|
import com.greenorange.promotion.model.entity.Course;
|
||||||
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author 35880
|
||||||
|
* @description 针对表【course(课程表)】的数据库操作Mapper
|
||||||
|
* @createDate 2025-06-23 18:29:49
|
||||||
|
* @Entity com.greenorange.promotion.model.entity.Course
|
||||||
|
*/
|
||||||
|
public interface CourseMapper extends BaseMapper<Course> {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -0,0 +1,18 @@
|
|||||||
|
package com.greenorange.promotion.mapper;
|
||||||
|
|
||||||
|
import com.greenorange.promotion.model.entity.CourseOrder;
|
||||||
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author 35880
|
||||||
|
* @description 针对表【course_order(课程订单表)】的数据库操作Mapper
|
||||||
|
* @createDate 2025-06-23 18:31:13
|
||||||
|
* @Entity com.greenorange.promotion.model.entity.CourseOrder
|
||||||
|
*/
|
||||||
|
public interface CourseOrderMapper extends BaseMapper<CourseOrder> {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -0,0 +1,18 @@
|
|||||||
|
package com.greenorange.promotion.mapper;
|
||||||
|
|
||||||
|
import com.greenorange.promotion.model.entity.CourseQrcodeApply;
|
||||||
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author 35880
|
||||||
|
* @description 针对表【course_qrcode_apply(课程推广码申请表)】的数据库操作Mapper
|
||||||
|
* @createDate 2025-06-24 22:10:39
|
||||||
|
* @Entity com.greenorange.promotion.model.entity.CourseQrcodeApply
|
||||||
|
*/
|
||||||
|
public interface CourseQrcodeApplyMapper extends BaseMapper<CourseQrcodeApply> {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -2,6 +2,8 @@ package com.greenorange.promotion.mapper;
|
|||||||
|
|
||||||
import com.greenorange.promotion.model.entity.ProjectCommission;
|
import com.greenorange.promotion.model.entity.ProjectCommission;
|
||||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
|
import org.apache.ibatis.annotations.Param;
|
||||||
|
import org.apache.ibatis.annotations.Update;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author 35880
|
* @author 35880
|
||||||
@ -11,6 +13,9 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
|||||||
*/
|
*/
|
||||||
public interface ProjectCommissionMapper extends BaseMapper<ProjectCommission> {
|
public interface ProjectCommissionMapper extends BaseMapper<ProjectCommission> {
|
||||||
|
|
||||||
|
|
||||||
|
@Update("${sql}")
|
||||||
|
void executeUpdate(@Param("sql") String sql);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -0,0 +1,18 @@
|
|||||||
|
package com.greenorange.promotion.mapper;
|
||||||
|
|
||||||
|
import com.greenorange.promotion.model.entity.PromoRecord;
|
||||||
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author 35880
|
||||||
|
* @description 针对表【promo_record(推广记录表)】的数据库操作Mapper
|
||||||
|
* @createDate 2025-06-23 18:31:45
|
||||||
|
* @Entity com.greenorange.promotion.model.entity.PromoRecord
|
||||||
|
*/
|
||||||
|
public interface PromoRecordMapper extends BaseMapper<PromoRecord> {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -0,0 +1,18 @@
|
|||||||
|
package com.greenorange.promotion.mapper;
|
||||||
|
|
||||||
|
import com.greenorange.promotion.model.entity.RakeReward;
|
||||||
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author 35880
|
||||||
|
* @description 针对表【rake_reward(课程抽成记录表)】的数据库操作Mapper
|
||||||
|
* @createDate 2025-06-23 18:32:46
|
||||||
|
* @Entity com.greenorange.promotion.model.entity.RakeReward
|
||||||
|
*/
|
||||||
|
public interface RakeRewardMapper extends BaseMapper<RakeReward> {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -2,6 +2,8 @@ package com.greenorange.promotion.mapper;
|
|||||||
|
|
||||||
import com.greenorange.promotion.model.entity.SubUserProjectCommission;
|
import com.greenorange.promotion.model.entity.SubUserProjectCommission;
|
||||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
|
import org.apache.ibatis.annotations.Param;
|
||||||
|
import org.apache.ibatis.annotations.Update;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author 35880
|
* @author 35880
|
||||||
@ -11,6 +13,9 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
|||||||
*/
|
*/
|
||||||
public interface SubUserProjectCommissionMapper extends BaseMapper<SubUserProjectCommission> {
|
public interface SubUserProjectCommissionMapper extends BaseMapper<SubUserProjectCommission> {
|
||||||
|
|
||||||
|
@Update("${sql}")
|
||||||
|
void executeUpdate(@Param("sql") String sql);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -0,0 +1,99 @@
|
|||||||
|
package com.greenorange.promotion.model.dto.course;
|
||||||
|
|
||||||
|
import com.greenorange.promotion.annotation.EnumValue;
|
||||||
|
import com.greenorange.promotion.model.enums.CourseTypeEnum;
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import jakarta.validation.constraints.DecimalMin;
|
||||||
|
import jakarta.validation.constraints.NotBlank;
|
||||||
|
import lombok.Data;
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
|
||||||
|
import java.io.Serial;
|
||||||
|
import java.io.Serializable;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 课程添加请求体
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@Schema(description = "课程添加请求体", requiredProperties = {
|
||||||
|
"name",
|
||||||
|
"type",
|
||||||
|
"detail",
|
||||||
|
"promoCodeDesc",
|
||||||
|
"image",
|
||||||
|
"originPrice",
|
||||||
|
"discountPrice",
|
||||||
|
"firstLevelRate",
|
||||||
|
"secondLevelRate",
|
||||||
|
})
|
||||||
|
public class CourseAddRequest implements Serializable {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 课程名称
|
||||||
|
*/
|
||||||
|
@NotBlank(message = "课程名称不能为空")
|
||||||
|
@Schema(description = "课程名称", example = "数据分析工程师训练营")
|
||||||
|
private String name;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 课程类别[考公考研,自媒体,财经]
|
||||||
|
*/
|
||||||
|
@NotBlank(message = "课程类别不能为空")
|
||||||
|
@EnumValue(enumClass = CourseTypeEnum.class)
|
||||||
|
@Schema(description = "课程类别[考公考研,自媒体,财经]", example = "自媒体")
|
||||||
|
private String type;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 课程概述(富文本)
|
||||||
|
*/
|
||||||
|
@NotBlank(message = "课程概述(富文本)不能为空")
|
||||||
|
@Schema(description = "课程概述(富文本)", example = "富文本")
|
||||||
|
private String detail;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 推广码说明(富文本)
|
||||||
|
*/
|
||||||
|
@NotBlank(message = "推广码说明(富文本)不能为空")
|
||||||
|
@Schema(description = "推广码说明(富文本)", example = "富文本")
|
||||||
|
private String promoCodeDesc;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 课程图片URL
|
||||||
|
*/
|
||||||
|
@NotBlank(message = "课程图片URL不能为空")
|
||||||
|
@Schema(description = "课程图片URL", example = "324IEHJDE")
|
||||||
|
private String image;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 课程原价
|
||||||
|
*/
|
||||||
|
@DecimalMin(value = "0", message = "课程原价不能小于0")
|
||||||
|
@Schema(description = "课程原价", example = "3499")
|
||||||
|
private BigDecimal originPrice;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 折扣价格
|
||||||
|
*/
|
||||||
|
@DecimalMin(value = "0", message = "折扣价格不能小于0")
|
||||||
|
@Schema(description = "折扣价格", example = "2499")
|
||||||
|
private BigDecimal discountPrice;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 一级佣金比例(%)
|
||||||
|
*/
|
||||||
|
@DecimalMin(value = "0", message = "一级佣金比例不能小于0")
|
||||||
|
@Schema(description = "一级佣金比例(%)", example = "10")
|
||||||
|
private BigDecimal firstLevelRate;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 二级佣金比例(%)
|
||||||
|
*/
|
||||||
|
@DecimalMin(value = "0", message = "二级佣金比例不能小于0")
|
||||||
|
@Schema(description = "二级佣金比例(%)", example = "5")
|
||||||
|
private BigDecimal secondLevelRate;
|
||||||
|
|
||||||
|
|
||||||
|
@Serial
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,48 @@
|
|||||||
|
package com.greenorange.promotion.model.dto.course;
|
||||||
|
|
||||||
|
import com.greenorange.promotion.annotation.EnumValue;
|
||||||
|
import com.greenorange.promotion.model.enums.CourseTypeEnum;
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import jakarta.validation.constraints.NotBlank;
|
||||||
|
import jakarta.validation.constraints.Min;
|
||||||
|
import jakarta.validation.constraints.NotNull;
|
||||||
|
import jdk.jfr.BooleanFlag;
|
||||||
|
import lombok.Data;
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
|
||||||
|
import java.io.Serial;
|
||||||
|
import java.io.Serializable;
|
||||||
|
import com.greenorange.promotion.common.PageRequest;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 课程查询请求体,继承自分页请求 PageRequest
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@Schema(description = "课程查询请求体", requiredProperties = {"current", "pageSize"})
|
||||||
|
public class CourseQueryRequest extends PageRequest implements Serializable {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 课程名称
|
||||||
|
*/
|
||||||
|
@Schema(description = "课程名称", example = "数据分析工程师训练营")
|
||||||
|
private String name;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 课程类别[考公考研,自媒体,财经]
|
||||||
|
*/
|
||||||
|
@EnumValue(enumClass = CourseTypeEnum.class)
|
||||||
|
@Schema(description = "课程类别[考公考研,自媒体,财经]", example = "自媒体")
|
||||||
|
private String type;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 是否上架(true:上架,false:下架)
|
||||||
|
*/
|
||||||
|
@Schema(description = "是否上架(true:上架,false:下架)", example = "true")
|
||||||
|
private Boolean isShelves;
|
||||||
|
|
||||||
|
|
||||||
|
@Serial
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,115 @@
|
|||||||
|
package com.greenorange.promotion.model.dto.course;
|
||||||
|
|
||||||
|
import com.greenorange.promotion.annotation.EnumValue;
|
||||||
|
import com.greenorange.promotion.model.enums.CourseTypeEnum;
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import jakarta.validation.constraints.DecimalMin;
|
||||||
|
import jakarta.validation.constraints.NotBlank;
|
||||||
|
import jakarta.validation.constraints.Min;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
|
||||||
|
import java.io.Serial;
|
||||||
|
import java.io.Serializable;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 课程更新请求体
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@Schema(description = "课程更新请求体", requiredProperties = {
|
||||||
|
"id",
|
||||||
|
"name",
|
||||||
|
"type",
|
||||||
|
"detail",
|
||||||
|
"promoCodeDesc",
|
||||||
|
"image",
|
||||||
|
"originPrice",
|
||||||
|
"discountPrice",
|
||||||
|
"orderCount",
|
||||||
|
"firstLevelRate",
|
||||||
|
"secondLevelRate",
|
||||||
|
})
|
||||||
|
public class CourseUpdateRequest implements Serializable {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 课程ID
|
||||||
|
*/
|
||||||
|
@Min(value = 1L, message = "课程ID ID不能小于1")
|
||||||
|
@Schema(description = "课程ID", example = "1")
|
||||||
|
private Long id;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 课程名称
|
||||||
|
*/
|
||||||
|
@NotBlank(message = "课程名称不能为空")
|
||||||
|
@Schema(description = "课程名称", example = "数据分析工程师训练营")
|
||||||
|
private String name;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 课程类别[考公考研,自媒体,财经]
|
||||||
|
*/
|
||||||
|
@NotBlank(message = "课程类别不能为空")
|
||||||
|
@EnumValue(enumClass = CourseTypeEnum.class)
|
||||||
|
@Schema(description = "课程类别[考公考研,自媒体,财经]", example = "自媒体")
|
||||||
|
private String type;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 课程概述(富文本)
|
||||||
|
*/
|
||||||
|
@NotBlank(message = "课程概述(富文本)不能为空")
|
||||||
|
@Schema(description = "课程概述(富文本)", example = "富文本")
|
||||||
|
private String detail;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 推广码说明(富文本)
|
||||||
|
*/
|
||||||
|
@NotBlank(message = "推广码说明(富文本)不能为空")
|
||||||
|
@Schema(description = "推广码说明(富文本)", example = "富文本")
|
||||||
|
private String promoCodeDesc;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 课程图片URL
|
||||||
|
*/
|
||||||
|
@NotBlank(message = "课程图片URL不能为空")
|
||||||
|
@Schema(description = "课程图片URL", example = "324IEHJDE")
|
||||||
|
private String image;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 课程原价
|
||||||
|
*/
|
||||||
|
@DecimalMin(value = "0.0", message = "课程原价不能小于0")
|
||||||
|
@Schema(description = "课程原价", example = "3499")
|
||||||
|
private BigDecimal originPrice;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 折扣价格
|
||||||
|
*/
|
||||||
|
@DecimalMin(value = "0.0", message = "折扣价格不能小于0")
|
||||||
|
@Schema(description = "折扣价格", example = "2499")
|
||||||
|
private BigDecimal discountPrice;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 已下单人数
|
||||||
|
*/
|
||||||
|
@Schema(description = "已下单人数", example = "100")
|
||||||
|
private Integer orderCount;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 一级佣金比例(%)
|
||||||
|
*/
|
||||||
|
@DecimalMin(value = "0.0", message = "一级佣金比例不能小于0")
|
||||||
|
@Schema(description = "一级佣金比例(%)", example = "10")
|
||||||
|
private BigDecimal firstLevelRate;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 二级佣金比例(%)
|
||||||
|
*/
|
||||||
|
@DecimalMin(value = "0.0", message = "二级佣金比例不能小于0")
|
||||||
|
@Schema(description = "二级佣金比例(%)", example = "5")
|
||||||
|
private BigDecimal secondLevelRate;
|
||||||
|
|
||||||
|
|
||||||
|
@Serial
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
}
|
@ -0,0 +1,67 @@
|
|||||||
|
package com.greenorange.promotion.model.dto.courseChapter;
|
||||||
|
|
||||||
|
import com.greenorange.promotion.annotation.EnumValue;
|
||||||
|
import com.greenorange.promotion.model.enums.PreviewPermissionEnum;
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import jakarta.validation.constraints.NotBlank;
|
||||||
|
import jakarta.validation.constraints.Min;
|
||||||
|
import lombok.Data;
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
|
||||||
|
import java.io.Serial;
|
||||||
|
import java.io.Serializable;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 课程章节添加请求体
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@Schema(description = "课程章节添加请求体", requiredProperties = {
|
||||||
|
"name",
|
||||||
|
"duration",
|
||||||
|
"permissions",
|
||||||
|
"videoView",
|
||||||
|
"courseId",
|
||||||
|
})
|
||||||
|
public class CourseChapterAddRequest implements Serializable {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 章节名称
|
||||||
|
*/
|
||||||
|
@NotBlank(message = "章节名称不能为空")
|
||||||
|
@Schema(description = "章节名称", example = "企业经营管理者为什么必须懂财务?")
|
||||||
|
private String name;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 章节时长(单位:秒)
|
||||||
|
*/
|
||||||
|
@Min(value = 0L, message = "章节时长不能小于0")
|
||||||
|
@Schema(description = "章节时长", example = "600")
|
||||||
|
private Long duration;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 试看权限[全集试看,部分试看,关闭,开启]
|
||||||
|
*/
|
||||||
|
@NotBlank(message = "试看权限不能为空")
|
||||||
|
@EnumValue(enumClass = PreviewPermissionEnum.class)
|
||||||
|
@Schema(description = "试看权限[全集试看,部分试看,关闭,开启]", example = "全集试看")
|
||||||
|
private String permissions;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 视频文件 view 值
|
||||||
|
*/
|
||||||
|
@NotBlank(message = "视频文件 view 值不能为空")
|
||||||
|
@Schema(description = "视频文件 view 值", example = "3E29KDS9")
|
||||||
|
private String videoView;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 所属课程ID
|
||||||
|
*/
|
||||||
|
@Min(value = 1L, message = "所属课程ID ID不能小于1")
|
||||||
|
@Schema(description = "所属课程ID", example = "1")
|
||||||
|
private Long courseId;
|
||||||
|
|
||||||
|
|
||||||
|
@Serial
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,48 @@
|
|||||||
|
package com.greenorange.promotion.model.dto.courseChapter;
|
||||||
|
|
||||||
|
import com.greenorange.promotion.annotation.EnumValue;
|
||||||
|
import com.greenorange.promotion.model.enums.PreviewPermissionEnum;
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import jakarta.validation.constraints.NotBlank;
|
||||||
|
import jakarta.validation.constraints.Min;
|
||||||
|
import jakarta.validation.constraints.NotNull;
|
||||||
|
import lombok.Data;
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
|
||||||
|
import java.io.Serial;
|
||||||
|
import java.io.Serializable;
|
||||||
|
import com.greenorange.promotion.common.PageRequest;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 课程章节查询请求体,继承自分页请求 PageRequest
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@Schema(description = "课程章节查询请求体", requiredProperties = {"current", "pageSize"})
|
||||||
|
public class CourseChapterQueryRequest extends PageRequest implements Serializable {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 章节名称
|
||||||
|
*/
|
||||||
|
@Schema(description = "章节名称", example = "企业经营管理者为什么必须懂财务?")
|
||||||
|
private String name;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 试看权限[全集试看,部分试看,关闭,开启]
|
||||||
|
*/
|
||||||
|
@EnumValue(enumClass = PreviewPermissionEnum.class)
|
||||||
|
@Schema(description = "试看权限[全集试看,部分试看,关闭,开启]", example = "全集试看")
|
||||||
|
private String permissions;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 课程id
|
||||||
|
*/
|
||||||
|
@NotNull(message = "课程id不能为null")
|
||||||
|
@Min(value = 1, message = "课程id不能小于1")
|
||||||
|
@Schema(description = "课程id", example = "1")
|
||||||
|
private Long courseId;
|
||||||
|
|
||||||
|
|
||||||
|
@Serial
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,74 @@
|
|||||||
|
package com.greenorange.promotion.model.dto.courseChapter;
|
||||||
|
|
||||||
|
import com.greenorange.promotion.annotation.EnumValue;
|
||||||
|
import com.greenorange.promotion.model.enums.PreviewPermissionEnum;
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import jakarta.validation.constraints.NotBlank;
|
||||||
|
import jakarta.validation.constraints.Min;
|
||||||
|
import lombok.Data;
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
|
||||||
|
import java.io.Serial;
|
||||||
|
import java.io.Serializable;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 课程章节更新请求体
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@Schema(description = "课程章节更新请求体", requiredProperties = {
|
||||||
|
"id",
|
||||||
|
"name",
|
||||||
|
"duration",
|
||||||
|
"permissions",
|
||||||
|
"videoView",
|
||||||
|
"courseId",
|
||||||
|
})
|
||||||
|
public class CourseChapterUpdateRequest implements Serializable {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 章节ID
|
||||||
|
*/
|
||||||
|
@Min(value = 1L, message = "章节ID ID不能小于1")
|
||||||
|
@Schema(description = "章节ID", example = "1")
|
||||||
|
private Long id;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 章节名称
|
||||||
|
*/
|
||||||
|
@NotBlank(message = "章节名称不能为空")
|
||||||
|
@Schema(description = "章节名称", example = "企业经营管理者为什么必须懂财务?")
|
||||||
|
private String name;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 章节时长(单位:秒)
|
||||||
|
*/
|
||||||
|
@Min(value = 0L, message = "章节时长不能小于0")
|
||||||
|
@Schema(description = "章节时长", example = "600")
|
||||||
|
private Long duration;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 试看权限[全集试看,部分试看,关闭,开启]
|
||||||
|
*/
|
||||||
|
@NotBlank(message = "试看权限不能为空")
|
||||||
|
@EnumValue(enumClass = PreviewPermissionEnum.class)
|
||||||
|
@Schema(description = "试看权限[全集试看,部分试看,关闭,开启]", example = "全集试看")
|
||||||
|
private String permissions;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 视频文件 view 值
|
||||||
|
*/
|
||||||
|
@NotBlank(message = "视频文件 view 值不能为空")
|
||||||
|
@Schema(description = "视频文件 view 值", example = "3E29KDS9")
|
||||||
|
private String videoView;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 所属课程ID
|
||||||
|
*/
|
||||||
|
@Min(value = 1L, message = "所属课程ID ID不能小于1")
|
||||||
|
@Schema(description = "所属课程ID", example = "1")
|
||||||
|
private Long courseId;
|
||||||
|
|
||||||
|
|
||||||
|
@Serial
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
}
|
@ -0,0 +1,92 @@
|
|||||||
|
package com.greenorange.promotion.model.dto.courseOrder;
|
||||||
|
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import jakarta.validation.constraints.Min;
|
||||||
|
import jakarta.validation.constraints.NotBlank;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.io.Serial;
|
||||||
|
import java.io.Serializable;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 课程订单添加请求体
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@Schema(description = "课程订单添加请求体", requiredProperties = {
|
||||||
|
"courseId"
|
||||||
|
})
|
||||||
|
public class CourseOrderAddRequest implements Serializable {
|
||||||
|
|
||||||
|
// /**
|
||||||
|
// * 订单号
|
||||||
|
// */
|
||||||
|
// @NotBlank(message = "订单号不能为空")
|
||||||
|
// @Schema(description = "订单号", example = "202506241339232334d234234243")
|
||||||
|
// private String orderNumber;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 课程ID
|
||||||
|
*/
|
||||||
|
@Min(value = 1L, message = "课程ID ID不能小于1")
|
||||||
|
@Schema(description = "课程ID", example = "1")
|
||||||
|
private Long courseId;
|
||||||
|
|
||||||
|
// /**
|
||||||
|
// * 课程名称
|
||||||
|
// */
|
||||||
|
// @NotBlank(message = "课程名称不能为空")
|
||||||
|
// @Schema(description = "课程名称", example = "数据分析工程师训练营")
|
||||||
|
// private String name;
|
||||||
|
//
|
||||||
|
// /**
|
||||||
|
// * 课程类别
|
||||||
|
// */
|
||||||
|
// @NotBlank(message = "课程类别不能为空")
|
||||||
|
// @Schema(description = "课程类别", example = "自媒体")
|
||||||
|
// private String type;
|
||||||
|
//
|
||||||
|
// /**
|
||||||
|
// * 课程封面图片URL
|
||||||
|
// */
|
||||||
|
// @NotBlank(message = "课程封面图片URL不能为空")
|
||||||
|
// @Schema(description = "课程封面图片URL", example = "38EFJID33")
|
||||||
|
// private String image;
|
||||||
|
//
|
||||||
|
// /**
|
||||||
|
// * 课程原价
|
||||||
|
// */
|
||||||
|
// @Schema(description = "课程原价", example = "20.00")
|
||||||
|
// private BigDecimal originPrice;
|
||||||
|
//
|
||||||
|
// /**
|
||||||
|
// * 折扣价格
|
||||||
|
// */
|
||||||
|
// @Schema(description = "折扣价格", example = "80.00")
|
||||||
|
// private BigDecimal discountPrice;
|
||||||
|
//
|
||||||
|
// /**
|
||||||
|
// * 订单总金额
|
||||||
|
// */
|
||||||
|
// @Schema(description = "订单总金额", example = "80.00")
|
||||||
|
// private BigDecimal totalAmount;
|
||||||
|
//
|
||||||
|
// /**
|
||||||
|
// * 支付交易号
|
||||||
|
// */
|
||||||
|
// @NotBlank(message = "支付交易号不能为空")
|
||||||
|
// @Schema(description = "支付交易号", example = "432332333324444444444444423")
|
||||||
|
// private String transactionNumber;
|
||||||
|
//
|
||||||
|
// /**
|
||||||
|
// * 订单状态
|
||||||
|
// */
|
||||||
|
// @NotBlank(message = "订单状态不能为空")
|
||||||
|
//// @EnumValue(enumClass = CourseOrderStatusEnum.class)
|
||||||
|
// @Schema(description = "订单状态", example = "order")
|
||||||
|
// private String orderStatus;
|
||||||
|
|
||||||
|
|
||||||
|
@Serial
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,41 @@
|
|||||||
|
package com.greenorange.promotion.model.dto.courseOrder;
|
||||||
|
|
||||||
|
import com.greenorange.promotion.annotation.EnumValue;
|
||||||
|
import com.greenorange.promotion.model.enums.OrderStatusEnum;
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import jakarta.validation.constraints.NotBlank;
|
||||||
|
import jakarta.validation.constraints.Min;
|
||||||
|
import lombok.Data;
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
|
||||||
|
import java.io.Serial;
|
||||||
|
import java.io.Serializable;
|
||||||
|
import com.greenorange.promotion.common.PageRequest;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 课程订单查询请求体,继承自分页请求 PageRequest
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@Schema(description = "课程订单查询请求体", requiredProperties = {"current", "pageSize"})
|
||||||
|
public class CourseOrderQueryRequest extends PageRequest implements Serializable {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 订单号
|
||||||
|
*/
|
||||||
|
@Schema(description = "订单号", example = "202506241339232334d234234243")
|
||||||
|
private String orderNumber;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 订单状态[交易关闭,交易成功,待支付,已退款]
|
||||||
|
*/
|
||||||
|
@EnumValue(enumClass = OrderStatusEnum.class)
|
||||||
|
@Schema(description = "订单状态[交易关闭,交易成功,待支付,已退款]", example = "交易成功")
|
||||||
|
private String orderStatus;
|
||||||
|
|
||||||
|
|
||||||
|
@Serial
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,43 @@
|
|||||||
|
package com.greenorange.promotion.model.dto.courseOrder;
|
||||||
|
|
||||||
|
import com.greenorange.promotion.annotation.EnumValue;
|
||||||
|
import com.greenorange.promotion.model.enums.OrderStatusEnum;
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import jakarta.validation.constraints.NotBlank;
|
||||||
|
import jakarta.validation.constraints.Min;
|
||||||
|
import lombok.Data;
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
|
||||||
|
import java.io.Serial;
|
||||||
|
import java.io.Serializable;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 课程订单更新请求体
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@Schema(description = "课程订单更新请求体", requiredProperties = {
|
||||||
|
"id",
|
||||||
|
"orderStatus"
|
||||||
|
})
|
||||||
|
public class CourseOrderUpdateRequest implements Serializable {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 订单ID
|
||||||
|
*/
|
||||||
|
@Min(value = 1L, message = "订单ID ID不能小于1")
|
||||||
|
@Schema(description = "订单ID", example = "1")
|
||||||
|
private Long id;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 订单状态[交易关闭,交易成功,待支付,已退款]
|
||||||
|
*/
|
||||||
|
@NotBlank(message = "订单状态不能为空")
|
||||||
|
@EnumValue(enumClass = OrderStatusEnum.class)
|
||||||
|
@Schema(description = "订单状态[交易关闭,交易成功,待支付,已退款]", example = "交易成功")
|
||||||
|
private String orderStatus;
|
||||||
|
|
||||||
|
|
||||||
|
@Serial
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
}
|
@ -1,13 +1,10 @@
|
|||||||
package com.greenorange.promotion.model.dto.fileInfo;
|
package com.greenorange.promotion.model.dto.fileInfo;
|
||||||
|
|
||||||
import com.greenorange.promotion.annotation.FileEnumValue;
|
import com.greenorange.promotion.annotation.EnumValue;
|
||||||
import com.greenorange.promotion.model.enums.FileUploadBizEnum;
|
import com.greenorange.promotion.model.enums.FileUploadBizEnum;
|
||||||
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 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;
|
||||||
@ -55,7 +52,7 @@ public class FileInfoAddRequest implements Serializable {
|
|||||||
/**
|
/**
|
||||||
* 文件业务类型[头像(avatar)|项目(project)|富文本(richText)|默认(default))]
|
* 文件业务类型[头像(avatar)|项目(project)|富文本(richText)|默认(default))]
|
||||||
*/
|
*/
|
||||||
@FileEnumValue(enumClass = FileUploadBizEnum.class)
|
@EnumValue(enumClass = FileUploadBizEnum.class)
|
||||||
@Schema(description = "文件业务类型[头像(avatar)|项目(project)|富文本(richText)|默认(default))]", example = "avatar")
|
@Schema(description = "文件业务类型[头像(avatar)|项目(project)|富文本(richText)|默认(default))]", example = "avatar")
|
||||||
private String biz;
|
private String biz;
|
||||||
|
|
||||||
|
@ -1,36 +0,0 @@
|
|||||||
package com.greenorange.promotion.model.dto.fileInfo;
|
|
||||||
|
|
||||||
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 com.greenorange.promotion.common.PageRequest;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 文件查询请求体,继承自分页请求 PageRequest
|
|
||||||
*/
|
|
||||||
@Data
|
|
||||||
@Schema(description = "文件查询请求体", requiredProperties = {"current", "pageSize"})
|
|
||||||
public class FileInfoQueryRequest extends PageRequest implements Serializable {
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 文件ID
|
|
||||||
*/
|
|
||||||
@Min(value = 1L, message = "文件ID ID不能小于1")
|
|
||||||
@Schema(description = "文件ID", example = "1")
|
|
||||||
private Long id;
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 文件view值
|
|
||||||
*/
|
|
||||||
@Schema(description = "文件view值", example = "3E8U2AM8")
|
|
||||||
private String fileView;
|
|
||||||
|
|
||||||
|
|
||||||
@Serial
|
|
||||||
private static final long serialVersionUID = 1L;
|
|
||||||
}
|
|
||||||
|
|
@ -1,79 +0,0 @@
|
|||||||
package com.greenorange.promotion.model.dto.fileInfo;
|
|
||||||
|
|
||||||
import com.greenorange.promotion.annotation.FileEnumValue;
|
|
||||||
import com.greenorange.promotion.model.enums.FileUploadBizEnum;
|
|
||||||
import io.swagger.v3.oas.annotations.media.Schema;
|
|
||||||
import jakarta.validation.constraints.NotBlank;
|
|
||||||
import jakarta.validation.constraints.Min;
|
|
||||||
import lombok.Data;
|
|
||||||
|
|
||||||
import java.io.Serial;
|
|
||||||
import java.io.Serializable;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 文件更新请求体
|
|
||||||
*/
|
|
||||||
@Data
|
|
||||||
@Schema(description = "文件更新请求体", requiredProperties = {
|
|
||||||
"id",
|
|
||||||
"name",
|
|
||||||
"type",
|
|
||||||
"size",
|
|
||||||
"fileView",
|
|
||||||
"biz",
|
|
||||||
})
|
|
||||||
public class FileInfoUpdateRequest implements Serializable {
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 文件ID
|
|
||||||
*/
|
|
||||||
@Min(value = 1L, message = "文件ID ID不能小于1")
|
|
||||||
@Schema(description = "文件ID", example = "1")
|
|
||||||
private Long id;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 文件名
|
|
||||||
*/
|
|
||||||
@NotBlank(message = "文件名不能为空")
|
|
||||||
@Schema(description = "文件名", example = "file.png")
|
|
||||||
private String name;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 文件类型
|
|
||||||
*/
|
|
||||||
@NotBlank(message = "文件类型不能为空")
|
|
||||||
@Schema(description = "文件类型", example = "png")
|
|
||||||
private String type;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 文件大小(KB)
|
|
||||||
*/
|
|
||||||
@Min(value = 1L, message = "文件大小 ID不能小于1")
|
|
||||||
@Schema(description = "文件大小", example = "3000")
|
|
||||||
private Double size;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 文件view值
|
|
||||||
*/
|
|
||||||
@NotBlank(message = "文件view值不能为空")
|
|
||||||
@Schema(description = "文件view值", example = "3E8U2AM8")
|
|
||||||
private String fileView;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 文件业务类型[头像(avatar)|项目(project)|富文本(richText)|默认(default))]
|
|
||||||
*/
|
|
||||||
@FileEnumValue(enumClass = FileUploadBizEnum.class)
|
|
||||||
@Schema(description = "文件业务类型[头像(avatar)|项目(project)|富文本(richText)|默认(default))]", example = "default")
|
|
||||||
private String biz;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 文件hash值
|
|
||||||
*/
|
|
||||||
@NotBlank(message = "文件hash值不能为空")
|
|
||||||
@Schema(description = "文件hash值", example = "3E8U2AM8")
|
|
||||||
private String hashValue;
|
|
||||||
|
|
||||||
|
|
||||||
@Serial
|
|
||||||
private static final long serialVersionUID = 1L;
|
|
||||||
}
|
|
@ -1,6 +1,6 @@
|
|||||||
package com.greenorange.promotion.model.dto.fileInfo;
|
package com.greenorange.promotion.model.dto.fileInfo;
|
||||||
|
|
||||||
import com.greenorange.promotion.annotation.FileEnumValue;
|
import com.greenorange.promotion.annotation.EnumValue;
|
||||||
import com.greenorange.promotion.model.enums.FileUploadBizEnum;
|
import com.greenorange.promotion.model.enums.FileUploadBizEnum;
|
||||||
import io.swagger.v3.oas.annotations.media.Schema;
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
@ -15,7 +15,7 @@ public class UploadFileRequest implements Serializable {
|
|||||||
/**
|
/**
|
||||||
* 文件业务类型[头像(avatar)|项目(project)|富文本(richText)|默认(default))]
|
* 文件业务类型[头像(avatar)|项目(project)|富文本(richText)|默认(default))]
|
||||||
*/
|
*/
|
||||||
@FileEnumValue(enumClass = FileUploadBizEnum.class)
|
@EnumValue(enumClass = FileUploadBizEnum.class)
|
||||||
@Schema(description = "文件业务类型[头像(avatar)|项目(project)|富文本(richText)|默认(default))]", example = "default")
|
@Schema(description = "文件业务类型[头像(avatar)|项目(project)|富文本(richText)|默认(default))]", example = "default")
|
||||||
private String biz;
|
private String biz;
|
||||||
|
|
||||||
|
@ -29,6 +29,12 @@ public class FundsChangeAddRequest implements Serializable {
|
|||||||
@Schema(description = "项目名称", example = "饿了么-超吃卡")
|
@Schema(description = "项目名称", example = "饿了么-超吃卡")
|
||||||
private String projectName;
|
private String projectName;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 项目明细名称
|
||||||
|
*/
|
||||||
|
@Schema(description = "项目明细名称", example = "2.9元购买30元券包")
|
||||||
|
private String projectDetailName;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 变动金额
|
* 变动金额
|
||||||
*/
|
*/
|
||||||
|
@ -1,21 +1,14 @@
|
|||||||
package com.greenorange.promotion.model.dto.project;
|
package com.greenorange.promotion.model.dto.project;
|
||||||
|
|
||||||
import com.greenorange.promotion.annotation.ProjectStatusEnumValue;
|
import com.greenorange.promotion.annotation.EnumValue;
|
||||||
import com.greenorange.promotion.model.dto.projectDetail.ProjectDetailAddRequest;
|
|
||||||
import com.greenorange.promotion.model.dto.projectDetail.ProjectDetailUpdateRequest;
|
|
||||||
import com.greenorange.promotion.model.dto.projectNotification.ProjectNotificationAddRequest;
|
|
||||||
import com.greenorange.promotion.model.entity.ProjectNotification;
|
|
||||||
import com.greenorange.promotion.model.enums.ProjectStatusEnum;
|
import com.greenorange.promotion.model.enums.ProjectStatusEnum;
|
||||||
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.NotBlank;
|
||||||
import jakarta.validation.constraints.NotEmpty;
|
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
|
||||||
import java.io.Serial;
|
import java.io.Serial;
|
||||||
import java.io.Serializable;
|
import java.io.Serializable;
|
||||||
import java.math.BigDecimal;
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 项目添加请求体
|
* 项目添加请求体
|
||||||
@ -66,7 +59,8 @@ public class ProjectAddRequest implements Serializable {
|
|||||||
/**
|
/**
|
||||||
* 项目状态[项目运行(running)|人数已满(full)|项目暂停(paused)]
|
* 项目状态[项目运行(running)|人数已满(full)|项目暂停(paused)]
|
||||||
*/
|
*/
|
||||||
@ProjectStatusEnumValue(enumClass = ProjectStatusEnum.class)
|
@NotBlank(message = "项目状态不能为空")
|
||||||
|
@EnumValue(enumClass = ProjectStatusEnum.class)
|
||||||
@Schema(description = "项目状态[项目运行(running)|人数已满(full)|项目暂停(paused)]", example = "running")
|
@Schema(description = "项目状态[项目运行(running)|人数已满(full)|项目暂停(paused)]", example = "running")
|
||||||
private String projectStatus;
|
private String projectStatus;
|
||||||
|
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
package com.greenorange.promotion.model.dto.project;
|
package com.greenorange.promotion.model.dto.project;
|
||||||
|
|
||||||
import com.greenorange.promotion.annotation.ProjectStatusEnumValue;
|
import com.greenorange.promotion.annotation.EnumValue;
|
||||||
import com.greenorange.promotion.model.enums.ProjectStatusEnum;
|
import com.greenorange.promotion.model.enums.ProjectStatusEnum;
|
||||||
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;
|
||||||
@ -27,7 +27,7 @@ public class ProjectStatusUpdateRequest implements Serializable {
|
|||||||
/**
|
/**
|
||||||
* 项目状态[项目运行(running)|人数已满(full)|项目暂停(paused)]
|
* 项目状态[项目运行(running)|人数已满(full)|项目暂停(paused)]
|
||||||
*/
|
*/
|
||||||
@ProjectStatusEnumValue(enumClass = ProjectStatusEnum.class)
|
@EnumValue(enumClass = ProjectStatusEnum.class)
|
||||||
@Schema(description = "项目状态[项目运行(running)|人数已满(full)|项目暂停(paused)]", example = "running")
|
@Schema(description = "项目状态[项目运行(running)|人数已满(full)|项目暂停(paused)]", example = "running")
|
||||||
private String projectStatus;
|
private String projectStatus;
|
||||||
|
|
||||||
|
@ -2,6 +2,8 @@ package com.greenorange.promotion.model.dto.project;
|
|||||||
|
|
||||||
import com.baomidou.mybatisplus.annotation.IdType;
|
import com.baomidou.mybatisplus.annotation.IdType;
|
||||||
import com.baomidou.mybatisplus.annotation.TableId;
|
import com.baomidou.mybatisplus.annotation.TableId;
|
||||||
|
import com.greenorange.promotion.annotation.EnumValue;
|
||||||
|
import com.greenorange.promotion.model.enums.ProjectStatusEnum;
|
||||||
import io.swagger.v3.oas.annotations.media.Schema;
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
import jakarta.validation.constraints.DecimalMin;
|
import jakarta.validation.constraints.DecimalMin;
|
||||||
import jakarta.validation.constraints.NotBlank;
|
import jakarta.validation.constraints.NotBlank;
|
||||||
@ -103,6 +105,7 @@ public class ProjectUpdateRequest implements Serializable {
|
|||||||
/**
|
/**
|
||||||
* 项目状态[项目运行(running)|人数已满(full)|项目暂停(paused)]
|
* 项目状态[项目运行(running)|人数已满(full)|项目暂停(paused)]
|
||||||
*/
|
*/
|
||||||
|
@EnumValue(enumClass = ProjectStatusEnum.class)
|
||||||
@Schema(description = "项目状态[项目运行(running)|人数已满(full)|项目暂停(paused)]", example = "running")
|
@Schema(description = "项目状态[项目运行(running)|人数已满(full)|项目暂停(paused)]", example = "running")
|
||||||
private String projectStatus;
|
private String projectStatus;
|
||||||
|
|
||||||
|
@ -1,10 +1,7 @@
|
|||||||
package com.greenorange.promotion.model.dto.userInfo;
|
package com.greenorange.promotion.model.dto.userInfo;
|
||||||
|
|
||||||
import com.greenorange.promotion.annotation.UserEnumValue;
|
|
||||||
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.Pattern;
|
|
||||||
import jakarta.validation.constraints.Size;
|
import jakarta.validation.constraints.Size;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
|
||||||
@ -16,7 +13,7 @@ import java.io.Serializable;
|
|||||||
*/
|
*/
|
||||||
@Data
|
@Data
|
||||||
@Schema(description = "用户添加请求体", requiredProperties = {"nickName", "userAvatar", "phoneNumber",
|
@Schema(description = "用户添加请求体", requiredProperties = {"nickName", "userAvatar", "phoneNumber",
|
||||||
"userAccount", "userPassword", "userRole"})
|
"userAccount", "userPassword"})
|
||||||
public class UserInfoAddRequest implements Serializable {
|
public class UserInfoAddRequest implements Serializable {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -2,6 +2,7 @@ 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;
|
||||||
|
import jakarta.validation.constraints.Pattern;
|
||||||
import jakarta.validation.constraints.Size;
|
import jakarta.validation.constraints.Size;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
|
||||||
@ -41,6 +42,7 @@ public class UserInfoRegisterRequest implements Serializable {
|
|||||||
* 邀请码
|
* 邀请码
|
||||||
*/
|
*/
|
||||||
@Schema(description = "邀请码", example = "666999")
|
@Schema(description = "邀请码", example = "666999")
|
||||||
|
@NotBlank(message = "邀请码不能为空")
|
||||||
private String invitationCode;
|
private String invitationCode;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -1,7 +1,5 @@
|
|||||||
package com.greenorange.promotion.model.dto.userInfo;
|
package com.greenorange.promotion.model.dto.userInfo;
|
||||||
|
|
||||||
import com.greenorange.promotion.annotation.UserEnumValue;
|
|
||||||
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.Min;
|
import jakarta.validation.constraints.Min;
|
||||||
import jakarta.validation.constraints.NotBlank;
|
import jakarta.validation.constraints.NotBlank;
|
||||||
@ -16,8 +14,8 @@ import java.io.Serializable;
|
|||||||
* 用户更新请求体
|
* 用户更新请求体
|
||||||
*/
|
*/
|
||||||
@Data
|
@Data
|
||||||
@Schema(description = "用户更新请求体", requiredProperties = {"id", "nickName", "userAvatar", "phoneNumber",
|
@Schema(description = "用户更新请求体", requiredProperties = {"id", "nickName", "userAvatar",
|
||||||
"userAccount", "userPassword", "userRole"})
|
"userAccount", "userPassword"})
|
||||||
public class UserInfoUpdateRequest implements Serializable {
|
public class UserInfoUpdateRequest implements Serializable {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -42,13 +40,6 @@ public class UserInfoUpdateRequest implements Serializable {
|
|||||||
@Schema(description = "用户头像URL", example = "3E8U2AM8")
|
@Schema(description = "用户头像URL", example = "3E8U2AM8")
|
||||||
private String userAvatar;
|
private String userAvatar;
|
||||||
|
|
||||||
/**
|
|
||||||
* 手机号
|
|
||||||
*/
|
|
||||||
@NotBlank(message = "手机号不能为空")
|
|
||||||
@Schema(description = "手机号", example = "15888610253")
|
|
||||||
private String phoneNumber;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 账号
|
* 账号
|
||||||
*/
|
*/
|
||||||
@ -65,25 +56,6 @@ public class UserInfoUpdateRequest implements Serializable {
|
|||||||
@Schema(description = "密码(建议加密存储)", example = "qingcheng")
|
@Schema(description = "密码(建议加密存储)", example = "qingcheng")
|
||||||
private String userPassword;
|
private String userPassword;
|
||||||
|
|
||||||
/**
|
|
||||||
* 邀请码
|
|
||||||
*/
|
|
||||||
@Schema(description = "邀请码", example = "666999")
|
|
||||||
private String invitationCode;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 用户角色
|
|
||||||
*/
|
|
||||||
@UserEnumValue(enumClass = UserRoleEnum.class)
|
|
||||||
@Schema(description = "用户角色", example = "user")
|
|
||||||
private String userRole;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 上级用户id
|
|
||||||
*/
|
|
||||||
@Schema(description = "上级用户id", example = "1")
|
|
||||||
private Long parentUserId;
|
|
||||||
|
|
||||||
|
|
||||||
@Serial
|
@Serial
|
||||||
private static final long serialVersionUID = 1L;
|
private static final long serialVersionUID = 1L;
|
||||||
|
@ -1,10 +1,6 @@
|
|||||||
package com.greenorange.promotion.model.dto.withdrawalApply;
|
package com.greenorange.promotion.model.dto.withdrawalApply;
|
||||||
|
|
||||||
import com.greenorange.promotion.annotation.WithdrawStatusEnumValue;
|
|
||||||
import com.greenorange.promotion.model.enums.WithdrawStatusEnum;
|
|
||||||
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.Min;
|
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
import java.math.BigDecimal;
|
import java.math.BigDecimal;
|
||||||
|
|
||||||
@ -16,9 +12,7 @@ import java.io.Serializable;
|
|||||||
*/
|
*/
|
||||||
@Data
|
@Data
|
||||||
@Schema(description = "提现申请记录添加请求体", requiredProperties = {
|
@Schema(description = "提现申请记录添加请求体", requiredProperties = {
|
||||||
"withdrawnAmount",
|
"withdrawnAmount"
|
||||||
"withdrawalStatus",
|
|
||||||
"userId",
|
|
||||||
})
|
})
|
||||||
public class WithdrawalApplyAddRequest implements Serializable {
|
public class WithdrawalApplyAddRequest implements Serializable {
|
||||||
|
|
||||||
|
@ -1,12 +1,9 @@
|
|||||||
package com.greenorange.promotion.model.dto.withdrawalApply;
|
package com.greenorange.promotion.model.dto.withdrawalApply;
|
||||||
|
|
||||||
import com.greenorange.promotion.annotation.WithdrawStatusEnumValue;
|
import com.greenorange.promotion.annotation.EnumValue;
|
||||||
import com.greenorange.promotion.model.enums.WithdrawStatusEnum;
|
import com.greenorange.promotion.model.enums.WithdrawStatusEnum;
|
||||||
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.Min;
|
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
import java.math.BigDecimal;
|
|
||||||
|
|
||||||
import java.io.Serial;
|
import java.io.Serial;
|
||||||
import java.io.Serializable;
|
import java.io.Serializable;
|
||||||
@ -22,6 +19,7 @@ public class WithdrawalApplyQueryRequest extends PageRequest implements Serializ
|
|||||||
/**
|
/**
|
||||||
* 提现状态[提现中(processing)|提现成功(success)|提现失败(failed)]
|
* 提现状态[提现中(processing)|提现成功(success)|提现失败(failed)]
|
||||||
*/
|
*/
|
||||||
|
@EnumValue(enumClass = WithdrawStatusEnum.class)
|
||||||
@Schema(description = "提现状态[提现中(processing)|提现成功(success)|提现失败(failed)]", example = "processing")
|
@Schema(description = "提现状态[提现中(processing)|提现成功(success)|提现失败(failed)]", example = "processing")
|
||||||
private String withdrawalStatus;
|
private String withdrawalStatus;
|
||||||
|
|
||||||
|
@ -1,9 +1,8 @@
|
|||||||
package com.greenorange.promotion.model.dto.withdrawalApply;
|
package com.greenorange.promotion.model.dto.withdrawalApply;
|
||||||
|
|
||||||
import com.greenorange.promotion.annotation.WithdrawStatusEnumValue;
|
import com.greenorange.promotion.annotation.EnumValue;
|
||||||
import com.greenorange.promotion.model.enums.WithdrawStatusEnum;
|
import com.greenorange.promotion.model.enums.WithdrawStatusEnum;
|
||||||
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.Min;
|
import jakarta.validation.constraints.Min;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
import java.math.BigDecimal;
|
import java.math.BigDecimal;
|
||||||
@ -17,9 +16,7 @@ import java.io.Serializable;
|
|||||||
@Data
|
@Data
|
||||||
@Schema(description = "提现申请记录更新请求体", requiredProperties = {
|
@Schema(description = "提现申请记录更新请求体", requiredProperties = {
|
||||||
"id",
|
"id",
|
||||||
"withdrawnAmount",
|
"withdrawalStatus"
|
||||||
"withdrawalStatus",
|
|
||||||
"userId",
|
|
||||||
})
|
})
|
||||||
public class WithdrawalApplyUpdateRequest implements Serializable {
|
public class WithdrawalApplyUpdateRequest implements Serializable {
|
||||||
|
|
||||||
@ -30,26 +27,13 @@ public class WithdrawalApplyUpdateRequest implements Serializable {
|
|||||||
@Schema(description = "提现申请ID", example = "1")
|
@Schema(description = "提现申请ID", example = "1")
|
||||||
private Long id;
|
private Long id;
|
||||||
|
|
||||||
/**
|
|
||||||
* 提现金额
|
|
||||||
*/
|
|
||||||
@Schema(description = "提现金额", example = "1.00")
|
|
||||||
private BigDecimal withdrawnAmount;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 提现状态[提现中(processing)|提现成功(success)|提现失败(failed)]
|
* 提现状态[提现中(processing)|提现成功(success)|提现失败(failed)]
|
||||||
*/
|
*/
|
||||||
@WithdrawStatusEnumValue(enumClass = WithdrawStatusEnum.class)
|
@EnumValue(enumClass = WithdrawStatusEnum.class)
|
||||||
@Schema(description = "提现状态[提现中(processing)|提现成功(success)|提现失败(failed)]", example = "processing")
|
@Schema(description = "提现状态[提现中(processing)|提现成功(success)|提现失败(failed)]", example = "processing")
|
||||||
private String withdrawalStatus;
|
private String withdrawalStatus;
|
||||||
|
|
||||||
/**
|
|
||||||
* 用户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;
|
||||||
|
@ -0,0 +1,97 @@
|
|||||||
|
package com.greenorange.promotion.model.entity;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.IdType;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableField;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableId;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
|
import java.io.Serializable;
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
import java.util.Date;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 课程表
|
||||||
|
* @TableName course
|
||||||
|
*/
|
||||||
|
@TableName(value ="course")
|
||||||
|
@Data
|
||||||
|
public class Course implements Serializable {
|
||||||
|
/**
|
||||||
|
* 课程ID
|
||||||
|
*/
|
||||||
|
@TableId(type = IdType.AUTO)
|
||||||
|
private Long id;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 课程名称
|
||||||
|
*/
|
||||||
|
private String name;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 课程类别[考公考研,自媒体,财经]
|
||||||
|
*/
|
||||||
|
private String type;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 课程概述(富文本)
|
||||||
|
*/
|
||||||
|
private String detail;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 推广码说明(富文本)
|
||||||
|
*/
|
||||||
|
private String promoCodeDesc;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 课程图片URL
|
||||||
|
*/
|
||||||
|
private String image;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 课程原价
|
||||||
|
*/
|
||||||
|
private BigDecimal originPrice;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 折扣价格
|
||||||
|
*/
|
||||||
|
private BigDecimal discountPrice;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 已下单人数
|
||||||
|
*/
|
||||||
|
private Integer orderCount;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 一级佣金比例(%)
|
||||||
|
*/
|
||||||
|
private BigDecimal firstLevelRate;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 二级佣金比例(%)
|
||||||
|
*/
|
||||||
|
private BigDecimal secondLevelRate;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 是否上架(true:上架,false:下架)
|
||||||
|
*/
|
||||||
|
private Boolean isShelves;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 是否删除
|
||||||
|
*/
|
||||||
|
private Integer isDelete;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 创建时间
|
||||||
|
*/
|
||||||
|
private Date createTime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 更新时间
|
||||||
|
*/
|
||||||
|
private Date updateTime;
|
||||||
|
|
||||||
|
@TableField(exist = false)
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
}
|
@ -0,0 +1,69 @@
|
|||||||
|
package com.greenorange.promotion.model.entity;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.IdType;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableField;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableId;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
|
|
||||||
|
import java.io.Serial;
|
||||||
|
import java.io.Serializable;
|
||||||
|
import java.util.Date;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 课程章节表
|
||||||
|
* @TableName course_chapter
|
||||||
|
*/
|
||||||
|
@TableName(value ="course_chapter")
|
||||||
|
@Data
|
||||||
|
public class CourseChapter implements Serializable {
|
||||||
|
/**
|
||||||
|
* 章节ID
|
||||||
|
*/
|
||||||
|
@TableId(type = IdType.AUTO)
|
||||||
|
private Long id;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 章节名称
|
||||||
|
*/
|
||||||
|
private String name;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 章节时长(格式可自定义,如"00:10:00")
|
||||||
|
*/
|
||||||
|
private Long duration;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 试看权限[全集试看,部分试看,关闭,开启]
|
||||||
|
*/
|
||||||
|
private String permissions;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 视频文件 view 值
|
||||||
|
*/
|
||||||
|
private String videoView;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 所属课程ID
|
||||||
|
*/
|
||||||
|
private Long courseId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 是否删除
|
||||||
|
*/
|
||||||
|
private Integer isDelete;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 创建时间
|
||||||
|
*/
|
||||||
|
private Date createTime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 更新时间
|
||||||
|
*/
|
||||||
|
private Date updateTime;
|
||||||
|
|
||||||
|
@Serial
|
||||||
|
@TableField(exist = false)
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
}
|
@ -0,0 +1,100 @@
|
|||||||
|
package com.greenorange.promotion.model.entity;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.IdType;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableField;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableId;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
|
|
||||||
|
import java.io.Serial;
|
||||||
|
import java.io.Serializable;
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
import java.util.Date;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 课程订单表
|
||||||
|
* @TableName course_order
|
||||||
|
*/
|
||||||
|
@TableName(value ="course_order")
|
||||||
|
@Data
|
||||||
|
public class CourseOrder implements Serializable {
|
||||||
|
/**
|
||||||
|
* 订单ID
|
||||||
|
*/
|
||||||
|
@TableId(type = IdType.AUTO)
|
||||||
|
private Long id;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 订单号
|
||||||
|
*/
|
||||||
|
private String orderNumber;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 课程ID
|
||||||
|
*/
|
||||||
|
private Long courseId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 课程名称
|
||||||
|
*/
|
||||||
|
private String name;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 课程类别
|
||||||
|
*/
|
||||||
|
private String type;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 课程封面图片URL
|
||||||
|
*/
|
||||||
|
private String image;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 课程原价
|
||||||
|
*/
|
||||||
|
private BigDecimal originPrice;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 折扣价格
|
||||||
|
*/
|
||||||
|
private BigDecimal discountPrice;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 订单总金额
|
||||||
|
*/
|
||||||
|
private BigDecimal totalAmount;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 支付交易号
|
||||||
|
*/
|
||||||
|
private String transactionNumber;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 订单状态[交易关闭,交易成功,待支付,已退款]
|
||||||
|
*/
|
||||||
|
private String orderStatus;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 用户id
|
||||||
|
*/
|
||||||
|
private Long userId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 是否删除
|
||||||
|
*/
|
||||||
|
private Integer isDelete;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 创建时间
|
||||||
|
*/
|
||||||
|
private Date createTime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 更新时间
|
||||||
|
*/
|
||||||
|
private Date updateTime;
|
||||||
|
|
||||||
|
@Serial
|
||||||
|
@TableField(exist = false)
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
}
|
@ -0,0 +1,63 @@
|
|||||||
|
package com.greenorange.promotion.model.entity;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.IdType;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableField;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableId;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
|
import java.io.Serializable;
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Builder;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 课程推广码申请表
|
||||||
|
* @TableName course_qrcode_apply
|
||||||
|
*/
|
||||||
|
@TableName(value ="course_qrcode_apply")
|
||||||
|
@Data
|
||||||
|
@NoArgsConstructor
|
||||||
|
@AllArgsConstructor
|
||||||
|
@Builder
|
||||||
|
public class CourseQrcodeApply implements Serializable {
|
||||||
|
/**
|
||||||
|
* 课程推广码申请id
|
||||||
|
*/
|
||||||
|
@TableId(type = IdType.AUTO)
|
||||||
|
private Long id;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 用户id
|
||||||
|
*/
|
||||||
|
private Long userId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 课程id
|
||||||
|
*/
|
||||||
|
private Long courseId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 课程推广码(view值)
|
||||||
|
*/
|
||||||
|
private String courseQrcode;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 是否删除
|
||||||
|
*/
|
||||||
|
private Integer isDelete;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 创建时间
|
||||||
|
*/
|
||||||
|
private Date createTime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 更新时间
|
||||||
|
*/
|
||||||
|
private Date updateTime;
|
||||||
|
|
||||||
|
@TableField(exist = false)
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
}
|
@ -8,6 +8,7 @@ import java.io.Serializable;
|
|||||||
import java.math.BigDecimal;
|
import java.math.BigDecimal;
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
|
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
import jakarta.validation.constraints.NotBlank;
|
import jakarta.validation.constraints.NotBlank;
|
||||||
import lombok.AllArgsConstructor;
|
import lombok.AllArgsConstructor;
|
||||||
import lombok.Builder;
|
import lombok.Builder;
|
||||||
@ -35,6 +36,11 @@ public class FundsChange implements Serializable {
|
|||||||
*/
|
*/
|
||||||
private String projectName;
|
private String projectName;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 项目明细名称
|
||||||
|
*/
|
||||||
|
private String projectDetailName;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 变动金额
|
* 变动金额
|
||||||
*/
|
*/
|
||||||
|
@ -0,0 +1,82 @@
|
|||||||
|
package com.greenorange.promotion.model.entity;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.IdType;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableField;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableId;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
|
import java.io.Serializable;
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
import java.util.Date;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 推广记录表
|
||||||
|
* @TableName promo_record
|
||||||
|
*/
|
||||||
|
@TableName(value ="promo_record")
|
||||||
|
@Data
|
||||||
|
public class PromoRecord implements Serializable {
|
||||||
|
/**
|
||||||
|
* 推广记录ID
|
||||||
|
*/
|
||||||
|
@TableId(type = IdType.AUTO)
|
||||||
|
private Long id;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 被推广课程ID
|
||||||
|
*/
|
||||||
|
private Long courseId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 下级用户ID
|
||||||
|
*/
|
||||||
|
private Long subUserId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 下级用户昵称
|
||||||
|
*/
|
||||||
|
private String nickName;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 下级用户手机号
|
||||||
|
*/
|
||||||
|
private String phone;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 下级带给上级的收益
|
||||||
|
*/
|
||||||
|
private BigDecimal benefits;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 绑定时间(字符串格式)
|
||||||
|
*/
|
||||||
|
private String bindTime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 推广类型
|
||||||
|
*/
|
||||||
|
private Object promoType;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 推广人(上级用户)ID
|
||||||
|
*/
|
||||||
|
private Long userId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 是否删除
|
||||||
|
*/
|
||||||
|
private Integer isDelete;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 创建时间
|
||||||
|
*/
|
||||||
|
private Date createTime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 更新时间
|
||||||
|
*/
|
||||||
|
private Date updateTime;
|
||||||
|
|
||||||
|
@TableField(exist = false)
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
}
|
@ -0,0 +1,112 @@
|
|||||||
|
package com.greenorange.promotion.model.entity;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.IdType;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableField;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableId;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
|
import java.io.Serializable;
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
import java.util.Date;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 课程抽成记录表
|
||||||
|
* @TableName rake_reward
|
||||||
|
*/
|
||||||
|
@TableName(value ="rake_reward")
|
||||||
|
@Data
|
||||||
|
public class RakeReward implements Serializable {
|
||||||
|
/**
|
||||||
|
* 抽成记录ID
|
||||||
|
*/
|
||||||
|
@TableId(type = IdType.AUTO)
|
||||||
|
private Long id;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 课程ID
|
||||||
|
*/
|
||||||
|
private Long courseId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 课程名称
|
||||||
|
*/
|
||||||
|
private String name;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 课程类别
|
||||||
|
*/
|
||||||
|
private String type;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 课程图片URL
|
||||||
|
*/
|
||||||
|
private String image;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 一级佣金比例(%)
|
||||||
|
*/
|
||||||
|
private BigDecimal firstLevelRate;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 二级佣金比例(%)
|
||||||
|
*/
|
||||||
|
private BigDecimal secondLevelRate;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 订单ID
|
||||||
|
*/
|
||||||
|
private Long orderId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 下单用户ID
|
||||||
|
*/
|
||||||
|
private Long userId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 下单用户昵称
|
||||||
|
*/
|
||||||
|
private String nickName;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 订单金额
|
||||||
|
*/
|
||||||
|
private BigDecimal totalAmount;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 订单创建日期
|
||||||
|
*/
|
||||||
|
private Date orderCreateTime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 对应推广记录ID
|
||||||
|
*/
|
||||||
|
private Long promoId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 推广类型
|
||||||
|
*/
|
||||||
|
private Object promoType;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 抽成补贴金额
|
||||||
|
*/
|
||||||
|
private BigDecimal reward;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 是否删除
|
||||||
|
*/
|
||||||
|
private Integer isDelete;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 创建时间
|
||||||
|
*/
|
||||||
|
private Date createTime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 更新时间
|
||||||
|
*/
|
||||||
|
private Date updateTime;
|
||||||
|
|
||||||
|
@TableField(exist = false)
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
}
|
@ -69,4 +69,5 @@ public class SubUserProjectCommission implements Serializable {
|
|||||||
|
|
||||||
@TableField(exist = false)
|
@TableField(exist = false)
|
||||||
private static final long serialVersionUID = 1L;
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
}
|
}
|
@ -44,6 +44,31 @@ public class WithdrawalApply implements Serializable {
|
|||||||
*/
|
*/
|
||||||
private Long userId;
|
private Long userId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 持卡人
|
||||||
|
*/
|
||||||
|
private String cardHolder;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 身份证号
|
||||||
|
*/
|
||||||
|
private String idCardNumber;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 手机号
|
||||||
|
*/
|
||||||
|
private String phoneNumber;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 银行卡号
|
||||||
|
*/
|
||||||
|
private String bankCardNumber;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 开户银行
|
||||||
|
*/
|
||||||
|
private String openBank;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 是否删除
|
* 是否删除
|
||||||
*/
|
*/
|
||||||
|
@ -0,0 +1,58 @@
|
|||||||
|
package com.greenorange.promotion.model.enums;
|
||||||
|
|
||||||
|
import com.greenorange.promotion.annotation.BaseEnum;
|
||||||
|
import lombok.Getter;
|
||||||
|
import org.apache.commons.lang3.StringUtils;
|
||||||
|
|
||||||
|
import java.util.Arrays;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 课程类型枚举
|
||||||
|
*/
|
||||||
|
@Getter
|
||||||
|
public enum CourseTypeEnum implements BaseEnum {
|
||||||
|
|
||||||
|
KAOGONGKAOYAN("考公考研"),
|
||||||
|
ZIMEITI("自媒体"),
|
||||||
|
CAIJING("财经");
|
||||||
|
|
||||||
|
private final String value;
|
||||||
|
|
||||||
|
CourseTypeEnum(String value) {
|
||||||
|
this.value = value;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* BaseEnum 要求的方法:返回枚举对应的校验值
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public String getValue() {
|
||||||
|
return this.value;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取所有枚举值列表
|
||||||
|
*/
|
||||||
|
public static List<String> getValues() {
|
||||||
|
return Arrays.stream(values())
|
||||||
|
.map(CourseTypeEnum::getValue)
|
||||||
|
.collect(Collectors.toList());
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据值获取对应的枚举对象
|
||||||
|
*/
|
||||||
|
public static CourseTypeEnum getEnumByValue(String value) {
|
||||||
|
if (StringUtils.isBlank(value)) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
for (CourseTypeEnum type : CourseTypeEnum.values()) {
|
||||||
|
if (type.value.equals(value)) {
|
||||||
|
return type;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
}
|
@ -1,5 +1,6 @@
|
|||||||
package com.greenorange.promotion.model.enums;
|
package com.greenorange.promotion.model.enums;
|
||||||
|
|
||||||
|
import com.greenorange.promotion.annotation.BaseEnum;
|
||||||
import lombok.Getter;
|
import lombok.Getter;
|
||||||
import org.apache.commons.lang3.StringUtils;
|
import org.apache.commons.lang3.StringUtils;
|
||||||
|
|
||||||
@ -11,7 +12,7 @@ import java.util.stream.Collectors;
|
|||||||
* 文件上传业务类型枚举
|
* 文件上传业务类型枚举
|
||||||
*/
|
*/
|
||||||
@Getter
|
@Getter
|
||||||
public enum FileUploadBizEnum {
|
public enum FileUploadBizEnum implements BaseEnum {
|
||||||
|
|
||||||
AVATAR("用户头像", "avatar"),
|
AVATAR("用户头像", "avatar"),
|
||||||
PROJECT("项目", "project"),
|
PROJECT("项目", "project"),
|
||||||
@ -26,6 +27,14 @@ public enum FileUploadBizEnum {
|
|||||||
this.value = value;
|
this.value = value;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* BaseEnum 要求的方法:返回这个枚举的“校验值”
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public String getValue() {
|
||||||
|
return this.value;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取值列表
|
* 获取值列表
|
||||||
*/
|
*/
|
||||||
|
@ -0,0 +1,59 @@
|
|||||||
|
package com.greenorange.promotion.model.enums;
|
||||||
|
|
||||||
|
import com.greenorange.promotion.annotation.BaseEnum;
|
||||||
|
import lombok.Getter;
|
||||||
|
import org.apache.commons.lang3.StringUtils;
|
||||||
|
|
||||||
|
import java.util.Arrays;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 订单状态枚举
|
||||||
|
*/
|
||||||
|
@Getter
|
||||||
|
public enum OrderStatusEnum implements BaseEnum {
|
||||||
|
|
||||||
|
CLOSED("交易关闭"),
|
||||||
|
SUCCESS("交易成功"),
|
||||||
|
PENDING("待支付"),
|
||||||
|
REFUNDED("已退款");
|
||||||
|
|
||||||
|
private final String value;
|
||||||
|
|
||||||
|
OrderStatusEnum(String value) {
|
||||||
|
this.value = value;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* BaseEnum 要求的方法:返回枚举对应的校验值
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public String getValue() {
|
||||||
|
return this.value;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取所有枚举值列表
|
||||||
|
*/
|
||||||
|
public static List<String> getValues() {
|
||||||
|
return Arrays.stream(values())
|
||||||
|
.map(OrderStatusEnum::getValue)
|
||||||
|
.collect(Collectors.toList());
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据值获取对应的枚举对象
|
||||||
|
*/
|
||||||
|
public static OrderStatusEnum getEnumByValue(String value) {
|
||||||
|
if (StringUtils.isBlank(value)) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
for (OrderStatusEnum status : OrderStatusEnum.values()) {
|
||||||
|
if (status.value.equals(value)) {
|
||||||
|
return status;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,59 @@
|
|||||||
|
package com.greenorange.promotion.model.enums;
|
||||||
|
|
||||||
|
import com.greenorange.promotion.annotation.BaseEnum;
|
||||||
|
import lombok.Getter;
|
||||||
|
import org.apache.commons.lang3.StringUtils;
|
||||||
|
|
||||||
|
import java.util.Arrays;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 试看权限枚举
|
||||||
|
*/
|
||||||
|
@Getter
|
||||||
|
public enum PreviewPermissionEnum implements BaseEnum {
|
||||||
|
|
||||||
|
FULL_VIEW("全集试看"),
|
||||||
|
PART_VIEW("部分试看"),
|
||||||
|
CLOSED("关闭"),
|
||||||
|
OPEN("开启");
|
||||||
|
|
||||||
|
private final String value;
|
||||||
|
|
||||||
|
PreviewPermissionEnum(String value) {
|
||||||
|
this.value = value;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* BaseEnum 要求的方法:返回枚举对应的校验值
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public String getValue() {
|
||||||
|
return this.value;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取所有枚举值列表
|
||||||
|
*/
|
||||||
|
public static List<String> getValues() {
|
||||||
|
return Arrays.stream(values())
|
||||||
|
.map(PreviewPermissionEnum::getValue)
|
||||||
|
.collect(Collectors.toList());
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据值获取对应的枚举对象
|
||||||
|
*/
|
||||||
|
public static PreviewPermissionEnum getEnumByValue(String value) {
|
||||||
|
if (StringUtils.isBlank(value)) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
for (PreviewPermissionEnum permission : PreviewPermissionEnum.values()) {
|
||||||
|
if (permission.value.equals(value)) {
|
||||||
|
return permission;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
}
|
@ -1,5 +1,6 @@
|
|||||||
package com.greenorange.promotion.model.enums;
|
package com.greenorange.promotion.model.enums;
|
||||||
|
|
||||||
|
import com.greenorange.promotion.annotation.BaseEnum;
|
||||||
import lombok.Getter;
|
import lombok.Getter;
|
||||||
import org.apache.commons.lang3.StringUtils;
|
import org.apache.commons.lang3.StringUtils;
|
||||||
|
|
||||||
@ -11,7 +12,7 @@ import java.util.stream.Collectors;
|
|||||||
* 项目状态枚举
|
* 项目状态枚举
|
||||||
*/
|
*/
|
||||||
@Getter
|
@Getter
|
||||||
public enum ProjectStatusEnum {
|
public enum ProjectStatusEnum implements BaseEnum {
|
||||||
|
|
||||||
RUNNING("项目运行", "running"),
|
RUNNING("项目运行", "running"),
|
||||||
FULL("人数已满", "full"),
|
FULL("人数已满", "full"),
|
||||||
@ -25,6 +26,14 @@ public enum ProjectStatusEnum {
|
|||||||
this.value = value;
|
this.value = value;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* BaseEnum 要求的方法:返回这个枚举的“校验值”
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public String getValue() {
|
||||||
|
return this.value;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取值列表
|
* 获取值列表
|
||||||
*/
|
*/
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
package com.greenorange.promotion.model.enums;
|
package com.greenorange.promotion.model.enums;
|
||||||
|
|
||||||
|
import com.greenorange.promotion.annotation.BaseEnum;
|
||||||
import lombok.Getter;
|
import lombok.Getter;
|
||||||
import org.apache.commons.lang3.StringUtils;
|
import org.apache.commons.lang3.StringUtils;
|
||||||
|
|
||||||
@ -12,7 +13,7 @@ import java.util.stream.Collectors;
|
|||||||
* 用户角色枚举
|
* 用户角色枚举
|
||||||
*/
|
*/
|
||||||
@Getter
|
@Getter
|
||||||
public enum UserRoleEnum {
|
public enum UserRoleEnum implements BaseEnum {
|
||||||
|
|
||||||
USER("用户", "user"),
|
USER("用户", "user"),
|
||||||
ADMIN("管理员", "admin"),
|
ADMIN("管理员", "admin"),
|
||||||
@ -29,6 +30,14 @@ public enum UserRoleEnum {
|
|||||||
this.value = value;
|
this.value = value;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* BaseEnum 要求的方法:返回这个枚举的“校验值”
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public String getValue() {
|
||||||
|
return this.value;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取值列表
|
* 获取值列表
|
||||||
*/
|
*/
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
package com.greenorange.promotion.model.enums;
|
package com.greenorange.promotion.model.enums;
|
||||||
|
|
||||||
|
import com.greenorange.promotion.annotation.BaseEnum;
|
||||||
import lombok.Getter;
|
import lombok.Getter;
|
||||||
import org.apache.commons.lang3.StringUtils;
|
import org.apache.commons.lang3.StringUtils;
|
||||||
|
|
||||||
@ -11,7 +12,7 @@ import java.util.stream.Collectors;
|
|||||||
* 提现状态枚举
|
* 提现状态枚举
|
||||||
*/
|
*/
|
||||||
@Getter
|
@Getter
|
||||||
public enum WithdrawStatusEnum {
|
public enum WithdrawStatusEnum implements BaseEnum {
|
||||||
|
|
||||||
PROCESSING("提现中", "processing"),
|
PROCESSING("提现中", "processing"),
|
||||||
SUCCESS("提现成功", "success"),
|
SUCCESS("提现成功", "success"),
|
||||||
@ -26,6 +27,14 @@ public enum WithdrawStatusEnum {
|
|||||||
this.value = value;
|
this.value = value;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* BaseEnum 要求的方法:返回这个枚举的“校验值”
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public String getValue() {
|
||||||
|
return this.value;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取所有状态的值列表
|
* 获取所有状态的值列表
|
||||||
*/
|
*/
|
||||||
|
@ -0,0 +1,60 @@
|
|||||||
|
package com.greenorange.promotion.model.vo.course;
|
||||||
|
|
||||||
|
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 CourseCardVO implements Serializable {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 课程ID
|
||||||
|
*/
|
||||||
|
@Schema(description = "课程ID", example = "1")
|
||||||
|
private Long id;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 课程名称
|
||||||
|
*/
|
||||||
|
@Schema(description = "课程名称", example = "数据分析工程师训练营")
|
||||||
|
private String name;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 课程类别[考公考研,自媒体,财经]
|
||||||
|
*/
|
||||||
|
@Schema(description = "课程类别[考公考研,自媒体,财经]", example = "自媒体")
|
||||||
|
private String type;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 课程图片URL
|
||||||
|
*/
|
||||||
|
@Schema(description = "课程图片URL", example = "324IEHJDE")
|
||||||
|
private String image;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 课程原价
|
||||||
|
*/
|
||||||
|
@Schema(description = "课程原价", example = "3499")
|
||||||
|
private BigDecimal originPrice;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 折扣价格
|
||||||
|
*/
|
||||||
|
@Schema(description = "折扣价格", example = "2499")
|
||||||
|
private BigDecimal discountPrice;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 已下单人数
|
||||||
|
*/
|
||||||
|
@Schema(description = "已下单人数", example = "100")
|
||||||
|
private Integer orderCount;
|
||||||
|
|
||||||
|
|
||||||
|
@Serial
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,75 @@
|
|||||||
|
package com.greenorange.promotion.model.vo.course;
|
||||||
|
|
||||||
|
import com.greenorange.promotion.model.vo.courseChapter.CourseChapterVO;
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.io.Serial;
|
||||||
|
import java.io.Serializable;
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
|
||||||
|
@Data
|
||||||
|
@Schema(description = "课程详情 视图对象")
|
||||||
|
public class CourseDetailVO implements Serializable {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 课程ID
|
||||||
|
*/
|
||||||
|
@Schema(description = "课程ID", example = "1")
|
||||||
|
private Long id;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 课程名称
|
||||||
|
*/
|
||||||
|
@Schema(description = "课程名称", example = "数据分析工程师训练营")
|
||||||
|
private String name;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 课程类别[考公考研,自媒体,财经]
|
||||||
|
*/
|
||||||
|
@Schema(description = "课程类别[考公考研,自媒体,财经]", example = "自媒体")
|
||||||
|
private String type;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 课程概述(富文本)
|
||||||
|
*/
|
||||||
|
@Schema(description = "课程概述(富文本)", example = "富文本")
|
||||||
|
private String detail;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 推广码说明(富文本)
|
||||||
|
*/
|
||||||
|
@Schema(description = "推广码说明(富文本)", example = "富文本")
|
||||||
|
private String promoCodeDesc;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 课程图片URL
|
||||||
|
*/
|
||||||
|
@Schema(description = "课程图片URL", example = "324IEHJDE")
|
||||||
|
private String image;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 课程原价
|
||||||
|
*/
|
||||||
|
@Schema(description = "课程原价", example = "3499")
|
||||||
|
private BigDecimal originPrice;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 折扣价格
|
||||||
|
*/
|
||||||
|
@Schema(description = "折扣价格", example = "2499")
|
||||||
|
private BigDecimal discountPrice;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 课程章节
|
||||||
|
*/
|
||||||
|
@Schema(description = "课程章节")
|
||||||
|
private List<CourseChapterVO> courseChapters;
|
||||||
|
|
||||||
|
|
||||||
|
@Serial
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,92 @@
|
|||||||
|
package com.greenorange.promotion.model.vo.course;
|
||||||
|
|
||||||
|
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 CourseVO implements Serializable {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 课程ID
|
||||||
|
*/
|
||||||
|
@Schema(description = "课程ID", example = "1")
|
||||||
|
private Long id;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 课程名称
|
||||||
|
*/
|
||||||
|
@Schema(description = "课程名称", example = "数据分析工程师训练营")
|
||||||
|
private String name;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 课程类别[考公考研,自媒体,财经]
|
||||||
|
*/
|
||||||
|
@Schema(description = "课程类别[考公考研,自媒体,财经]", example = "自媒体")
|
||||||
|
private String type;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 课程概述(富文本)
|
||||||
|
*/
|
||||||
|
@Schema(description = "课程概述(富文本)", example = "富文本")
|
||||||
|
private String detail;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 推广码说明(富文本)
|
||||||
|
*/
|
||||||
|
@Schema(description = "推广码说明(富文本)", example = "富文本")
|
||||||
|
private String promoCodeDesc;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 课程图片URL
|
||||||
|
*/
|
||||||
|
@Schema(description = "课程图片URL", example = "324IEHJDE")
|
||||||
|
private String image;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 课程原价
|
||||||
|
*/
|
||||||
|
@Schema(description = "课程原价", example = "3499")
|
||||||
|
private BigDecimal originPrice;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 折扣价格
|
||||||
|
*/
|
||||||
|
@Schema(description = "折扣价格", example = "2499")
|
||||||
|
private BigDecimal discountPrice;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 已下单人数
|
||||||
|
*/
|
||||||
|
@Schema(description = "已下单人数", example = "100")
|
||||||
|
private Integer orderCount;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 一级佣金比例(%)
|
||||||
|
*/
|
||||||
|
@Schema(description = "一级佣金比例(%)", example = "10")
|
||||||
|
private BigDecimal firstLevelRate;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 二级佣金比例(%)
|
||||||
|
*/
|
||||||
|
@Schema(description = "二级佣金比例(%)", example = "5")
|
||||||
|
private BigDecimal secondLevelRate;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 是否上架(true:上架,false:下架)
|
||||||
|
*/
|
||||||
|
@Schema(description = "是否上架(true:上架,false:下架)", example = "true")
|
||||||
|
private Boolean isShelves;
|
||||||
|
|
||||||
|
|
||||||
|
@Serial
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
}
|
@ -0,0 +1,58 @@
|
|||||||
|
package com.greenorange.promotion.model.vo.courseChapter;
|
||||||
|
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import jakarta.validation.constraints.Min;
|
||||||
|
import jakarta.validation.constraints.NotBlank;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.io.Serial;
|
||||||
|
import java.io.Serializable;
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 课程章节 视图对象
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@Schema(description = "课程章节 视图对象")
|
||||||
|
public class CourseChapterVO implements Serializable {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 课程章节ID
|
||||||
|
*/
|
||||||
|
@Schema(description = "课程章节ID", example = "1")
|
||||||
|
private Long id;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 章节名称
|
||||||
|
*/
|
||||||
|
@Schema(description = "章节名称", example = "企业经营管理者为什么必须懂财务?")
|
||||||
|
private String name;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 章节时长(单位:秒)
|
||||||
|
*/
|
||||||
|
@Schema(description = "章节时长", example = "600")
|
||||||
|
private Long duration;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 试看权限[全集试看,部分试看,关闭,开启]
|
||||||
|
*/
|
||||||
|
@Schema(description = "试看权限[全集试看,部分试看,关闭,开启]", example = "全集试看")
|
||||||
|
private String permissions;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 视频文件 view 值
|
||||||
|
*/
|
||||||
|
@Schema(description = "视频文件 view 值", example = "3E29KDS9")
|
||||||
|
private String videoView;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 所属课程ID
|
||||||
|
*/
|
||||||
|
@Schema(description = "所属课程ID", example = "所属课程ID ID不能小于1")
|
||||||
|
private Long courseId;
|
||||||
|
|
||||||
|
|
||||||
|
@Serial
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
}
|
@ -0,0 +1,60 @@
|
|||||||
|
package com.greenorange.promotion.model.vo.courseOrder;
|
||||||
|
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 课程订单卡片 视图对象
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@Schema(description = "课程订单卡片 视图对象")
|
||||||
|
public class CourseOrderCardVO implements Serializable {
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 课程订单ID
|
||||||
|
*/
|
||||||
|
@Schema(description = "课程订单ID", example = "1")
|
||||||
|
private Long id;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 订单号
|
||||||
|
*/
|
||||||
|
@Schema(description = "订单号", example = "202506241339232334d234234243")
|
||||||
|
private String orderNumber;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 课程名称
|
||||||
|
*/
|
||||||
|
@Schema(description = "课程名称", example = "数据分析工程师训练营")
|
||||||
|
private String name;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 课程类别
|
||||||
|
*/
|
||||||
|
@Schema(description = "课程类别", example = "自媒体")
|
||||||
|
private String type;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 订单总金额
|
||||||
|
*/
|
||||||
|
@Schema(description = "订单总金额", example = "100.00")
|
||||||
|
private BigDecimal totalAmount;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 订单状态[交易关闭,交易成功,待支付,已退款]
|
||||||
|
*/
|
||||||
|
@Schema(description = "订单状态[交易关闭,交易成功,待支付,已退款]", example = "交易成功")
|
||||||
|
private String orderStatus;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 创建时间
|
||||||
|
*/
|
||||||
|
@Schema(description = "创建时间", example = "2025-06-24 13:39:23")
|
||||||
|
private Date createTime;
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,105 @@
|
|||||||
|
package com.greenorange.promotion.model.vo.courseOrder;
|
||||||
|
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.io.Serial;
|
||||||
|
import java.io.Serializable;
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 课程订单 视图对象
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@Schema(description = "课程订单 视图对象")
|
||||||
|
public class CourseOrderVO implements Serializable {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 课程订单ID
|
||||||
|
*/
|
||||||
|
@Schema(description = "课程订单ID", example = "1")
|
||||||
|
private Long id;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 订单号
|
||||||
|
*/
|
||||||
|
@Schema(description = "订单号", example = "202506241339232334d234234243")
|
||||||
|
private String orderNumber;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 课程ID
|
||||||
|
*/
|
||||||
|
@Schema(description = "课程ID", example = "1")
|
||||||
|
private Long courseId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 课程名称
|
||||||
|
*/
|
||||||
|
@Schema(description = "课程名称", example = "数据分析工程师训练营")
|
||||||
|
private String name;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 课程类别
|
||||||
|
*/
|
||||||
|
@Schema(description = "课程类别", example = "自媒体")
|
||||||
|
private String type;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 课程封面图片URL
|
||||||
|
*/
|
||||||
|
@Schema(description = "课程封面图片URL", example = "32DHDF3KI")
|
||||||
|
private String image;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 课程原价
|
||||||
|
*/
|
||||||
|
@Schema(description = "课程原价", example = "100.00")
|
||||||
|
private BigDecimal originPrice;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 折扣价格
|
||||||
|
*/
|
||||||
|
@Schema(description = "折扣价格", example = "50.00")
|
||||||
|
private BigDecimal discountPrice;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 订单总金额
|
||||||
|
*/
|
||||||
|
@Schema(description = "订单总金额", example = "100.00")
|
||||||
|
private BigDecimal totalAmount;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 支付交易号
|
||||||
|
*/
|
||||||
|
@Schema(description = "支付交易号", example = "4342348232388888833333333333")
|
||||||
|
private String transactionNumber;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 订单状态[交易关闭,交易成功,待支付,已退款]
|
||||||
|
*/
|
||||||
|
@Schema(description = "订单状态[交易关闭,交易成功,待支付,已退款]", example = "交易成功")
|
||||||
|
private String orderStatus;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 用户id
|
||||||
|
*/
|
||||||
|
@Schema(description = "用户id", example = "1")
|
||||||
|
private Long userId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 创建时间
|
||||||
|
*/
|
||||||
|
@Schema(description = "创建时间", example = "2025-06-24 13:39:23")
|
||||||
|
private Date createTime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 更新时间
|
||||||
|
*/
|
||||||
|
@Schema(description = "更新时间", example = "2025-06-24 13:39:23")
|
||||||
|
private Date updateTime;
|
||||||
|
|
||||||
|
|
||||||
|
@Serial
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
}
|
@ -1,6 +1,7 @@
|
|||||||
package com.greenorange.promotion.model.vo.fundsChange;
|
package com.greenorange.promotion.model.vo.fundsChange;
|
||||||
|
|
||||||
import io.swagger.v3.oas.annotations.media.Schema;
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import jakarta.validation.constraints.NotBlank;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
|
||||||
import java.io.Serial;
|
import java.io.Serial;
|
||||||
@ -27,6 +28,12 @@ public class FundsChangeVO implements Serializable {
|
|||||||
@Schema(description = "项目名称", example = "饿了么-超吃卡")
|
@Schema(description = "项目名称", example = "饿了么-超吃卡")
|
||||||
private String projectName;
|
private String projectName;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 项目明细名称
|
||||||
|
*/
|
||||||
|
@Schema(description = "项目明细名称", example = "2.9元购买30元券包")
|
||||||
|
private String projectDetailName;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 变动金额
|
* 变动金额
|
||||||
*/
|
*/
|
||||||
|
@ -1,13 +1,17 @@
|
|||||||
package com.greenorange.promotion.model.vo.project;
|
package com.greenorange.promotion.model.vo.project;
|
||||||
|
|
||||||
import io.swagger.v3.oas.annotations.media.Schema;
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
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;
|
||||||
|
|
||||||
@Data
|
@Data
|
||||||
|
@NoArgsConstructor
|
||||||
|
@AllArgsConstructor
|
||||||
public class ProjectCardVO implements Serializable {
|
public class ProjectCardVO implements Serializable {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -0,0 +1,36 @@
|
|||||||
|
package com.greenorange.promotion.model.vo.userAccount;
|
||||||
|
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Builder;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
|
import java.io.Serial;
|
||||||
|
import java.io.Serializable;
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
@NoArgsConstructor
|
||||||
|
@AllArgsConstructor
|
||||||
|
@Builder
|
||||||
|
@Schema(description = "用户账户情况 视图对象")
|
||||||
|
public class UserAccountConditionVO implements Serializable {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 当前余额
|
||||||
|
*/
|
||||||
|
@Schema(description = "当前余额", example = "10.00")
|
||||||
|
private BigDecimal currentBalance;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 银行卡号
|
||||||
|
*/
|
||||||
|
@Schema(description = "银行卡号", example = "5105105105105100")
|
||||||
|
private String bankCardNumber;
|
||||||
|
|
||||||
|
|
||||||
|
@Serial
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,30 @@
|
|||||||
|
package com.greenorange.promotion.model.vo.userInfo;
|
||||||
|
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.io.Serial;
|
||||||
|
import java.io.Serializable;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 上级用户信息 视图对象
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@Schema(description = "上级用户信息 视图对象")
|
||||||
|
public class SuperUserInfoVO implements Serializable {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 用户昵称
|
||||||
|
*/
|
||||||
|
@Schema(description = "用户昵称", example = "chenxinzhi")
|
||||||
|
private String nickName;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 手机号
|
||||||
|
*/
|
||||||
|
@Schema(description = "手机号", example = "15888610253")
|
||||||
|
private String phoneNumber;
|
||||||
|
|
||||||
|
@Serial
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
}
|
@ -20,6 +20,36 @@ public class WithdrawalApplyVO implements Serializable {
|
|||||||
@Schema(description = "提现申请记录ID", example = "1")
|
@Schema(description = "提现申请记录ID", example = "1")
|
||||||
private Long id;
|
private Long id;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 持卡人
|
||||||
|
*/
|
||||||
|
@Schema(description = "持卡人", example = "chenxinzhi")
|
||||||
|
private String cardHolder;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 身份证号
|
||||||
|
*/
|
||||||
|
@Schema(description = "身份证号", example = "110101199001011234")
|
||||||
|
private String idCardNumber;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 手机号
|
||||||
|
*/
|
||||||
|
@Schema(description = "手机号", example = "15888610253")
|
||||||
|
private String phoneNumber;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 银行卡号
|
||||||
|
*/
|
||||||
|
@Schema(description = "银行卡号", example = "5105105105105100")
|
||||||
|
private String bankCardNumber;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 开户银行
|
||||||
|
*/
|
||||||
|
@Schema(description = "开户银行", example = "中国工商银行")
|
||||||
|
private String openBank;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 提现金额
|
* 提现金额
|
||||||
*/
|
*/
|
||||||
|
@ -0,0 +1,20 @@
|
|||||||
|
package com.greenorange.promotion.service.course;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||||
|
import com.greenorange.promotion.model.dto.courseChapter.CourseChapterQueryRequest;
|
||||||
|
import com.greenorange.promotion.model.entity.CourseChapter;
|
||||||
|
import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author 35880
|
||||||
|
* @description 针对表【course_chapter(课程章节表)】的数据库操作Service
|
||||||
|
* @createDate 2025-06-23 18:30:28
|
||||||
|
*/
|
||||||
|
public interface CourseChapterService extends IService<CourseChapter> {
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取查询条件
|
||||||
|
*/
|
||||||
|
QueryWrapper<CourseChapter> getQueryWrapper(CourseChapterQueryRequest courseChapterQueryRequest);
|
||||||
|
}
|
@ -0,0 +1,20 @@
|
|||||||
|
package com.greenorange.promotion.service.course;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||||
|
import com.greenorange.promotion.model.dto.courseOrder.CourseOrderQueryRequest;
|
||||||
|
import com.greenorange.promotion.model.entity.CourseOrder;
|
||||||
|
import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author 35880
|
||||||
|
* @description 针对表【course_order(课程订单表)】的数据库操作Service
|
||||||
|
* @createDate 2025-06-23 18:31:13
|
||||||
|
*/
|
||||||
|
public interface CourseOrderService extends IService<CourseOrder> {
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取查询条件
|
||||||
|
*/
|
||||||
|
QueryWrapper<CourseOrder> getQueryWrapper(CourseOrderQueryRequest courseOrderQueryRequest);
|
||||||
|
}
|
@ -0,0 +1,13 @@
|
|||||||
|
package com.greenorange.promotion.service.course;
|
||||||
|
|
||||||
|
import com.greenorange.promotion.model.entity.CourseQrcodeApply;
|
||||||
|
import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author 35880
|
||||||
|
* @description 针对表【course_qrcode_apply(课程推广码申请表)】的数据库操作Service
|
||||||
|
* @createDate 2025-06-24 22:10:39
|
||||||
|
*/
|
||||||
|
public interface CourseQrcodeApplyService extends IService<CourseQrcodeApply> {
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,20 @@
|
|||||||
|
package com.greenorange.promotion.service.course;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||||
|
import com.greenorange.promotion.model.dto.course.CourseQueryRequest;
|
||||||
|
import com.greenorange.promotion.model.entity.Course;
|
||||||
|
import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author 35880
|
||||||
|
* @description 针对表【course(课程表)】的数据库操作Service
|
||||||
|
* @createDate 2025-06-23 18:29:49
|
||||||
|
*/
|
||||||
|
public interface CourseService extends IService<Course> {
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取查询条件
|
||||||
|
*/
|
||||||
|
QueryWrapper<Course> getQueryWrapper(CourseQueryRequest courseQueryRequest);
|
||||||
|
}
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user