Compare commits
8 Commits
bbd063c4cd
...
dev
Author | SHA1 | Date | |
---|---|---|---|
cbaa7f8a0c | |||
8d766edec3 | |||
a0557729c6 | |||
656bee3ad1 | |||
5f7c3b50ff | |||
869fd1a8b1 | |||
e880431e07 | |||
1513ea51dc |
7
pom.xml
7
pom.xml
@ -214,6 +214,13 @@
|
|||||||
<version>2.6.9</version>
|
<version>2.6.9</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.springframework.security</groupId>
|
||||||
|
<artifactId>spring-security-crypto</artifactId>
|
||||||
|
<version>5.8.7</version> <!-- 换成你项目里使用的 Spring Security 版本 -->
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -43,4 +43,19 @@ public interface UserConstant {
|
|||||||
*/
|
*/
|
||||||
String BAN_ROLE = "ban";
|
String BAN_ROLE = "ban";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 经理
|
||||||
|
*/
|
||||||
|
String MANAGER_ROLE = "manager";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 主管
|
||||||
|
*/
|
||||||
|
String SUPERVISOR_ROLE = "supervisor";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 员工
|
||||||
|
*/
|
||||||
|
String STAFF_ROLE = "staff";
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -1,145 +0,0 @@
|
|||||||
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);
|
|
||||||
}
|
|
||||||
}
|
|
@ -10,7 +10,6 @@ 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;
|
||||||
@ -19,16 +18,10 @@ import com.greenorange.promotion.model.dto.course.CourseAddRequest;
|
|||||||
import com.greenorange.promotion.model.dto.course.CourseQueryRequest;
|
import com.greenorange.promotion.model.dto.course.CourseQueryRequest;
|
||||||
import com.greenorange.promotion.model.dto.course.CourseUpdateRequest;
|
import com.greenorange.promotion.model.dto.course.CourseUpdateRequest;
|
||||||
import com.greenorange.promotion.model.entity.Course;
|
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.CourseCardVO;
|
||||||
import com.greenorange.promotion.model.vo.course.CourseDetailVO;
|
import com.greenorange.promotion.model.vo.course.CourseDetailVO;
|
||||||
import com.greenorange.promotion.model.vo.course.CourseVO;
|
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.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.course.CourseService;
|
||||||
import com.greenorange.promotion.service.wechat.WechatGetQrcodeService;
|
import com.greenorange.promotion.service.wechat.WechatGetQrcodeService;
|
||||||
import io.swagger.v3.oas.annotations.Operation;
|
import io.swagger.v3.oas.annotations.Operation;
|
||||||
@ -63,16 +56,9 @@ public class CourseController {
|
|||||||
@Resource
|
@Resource
|
||||||
private CommonService commonService;
|
private CommonService commonService;
|
||||||
|
|
||||||
@Resource
|
|
||||||
private CourseChapterService courseChapterService;
|
|
||||||
|
|
||||||
@Resource
|
@Resource
|
||||||
private WechatGetQrcodeService wechatGetQrcodeService;
|
private WechatGetQrcodeService wechatGetQrcodeService;
|
||||||
|
|
||||||
@Resource
|
|
||||||
private CourseQrcodeApplyService courseQrcodeApplyService;
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 小程序端用户查看热门课程列表
|
* 小程序端用户查看热门课程列表
|
||||||
@ -124,29 +110,10 @@ public class CourseController {
|
|||||||
Long id = commonRequest.getId();
|
Long id = commonRequest.getId();
|
||||||
Course course = courseService.getById(id);
|
Course course = courseService.getById(id);
|
||||||
CourseDetailVO courseDetailVO = commonService.copyProperties(course, CourseDetailVO.class);
|
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);
|
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查看课程基本信息
|
* 小程序端用户根据id查看课程基本信息
|
||||||
@ -165,24 +132,6 @@ public class CourseController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 小程序端用户查看当前课程推广码
|
|
||||||
* @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());
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@ -200,9 +149,6 @@ public class CourseController {
|
|||||||
@RequiresPermission(mustRole = UserConstant.ADMIN_ROLE)
|
@RequiresPermission(mustRole = UserConstant.ADMIN_ROLE)
|
||||||
@SysLog(title = "课程管理", content = "web端管理员添加课程")
|
@SysLog(title = "课程管理", content = "web端管理员添加课程")
|
||||||
public BaseResponse<Long> addCourse(@Valid @RequestBody CourseAddRequest courseAddRequest) {
|
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);
|
Course course = commonService.copyProperties(courseAddRequest, Course.class);
|
||||||
courseService.save(course);
|
courseService.save(course);
|
||||||
return ResultUtils.success(course.getId());
|
return ResultUtils.success(course.getId());
|
||||||
@ -235,9 +181,6 @@ public class CourseController {
|
|||||||
public BaseResponse<Boolean> delCourse(@Valid @RequestBody CommonRequest commonRequest) {
|
public BaseResponse<Boolean> delCourse(@Valid @RequestBody CommonRequest commonRequest) {
|
||||||
Long id = commonRequest.getId();
|
Long id = commonRequest.getId();
|
||||||
courseService.removeById(id);
|
courseService.removeById(id);
|
||||||
// 删除课程下的所有章节
|
|
||||||
LambdaQueryWrapper<CourseChapter> lambdaQueryWrapper = commonService.buildQueryWrapperByField(CourseChapter::getCourseId, id, courseChapterService);
|
|
||||||
courseChapterService.remove(lambdaQueryWrapper);
|
|
||||||
return ResultUtils.success(true);
|
return ResultUtils.success(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -253,10 +196,6 @@ public class CourseController {
|
|||||||
public BaseResponse<Boolean> delBatchCourse(@Valid @RequestBody CommonBatchRequest commonBatchRequest) {
|
public BaseResponse<Boolean> delBatchCourse(@Valid @RequestBody CommonBatchRequest commonBatchRequest) {
|
||||||
List<Long> ids = commonBatchRequest.getIds();
|
List<Long> ids = commonBatchRequest.getIds();
|
||||||
courseService.removeByIds(ids);
|
courseService.removeByIds(ids);
|
||||||
// 批量删除课程下的所有章节
|
|
||||||
LambdaQueryWrapper<CourseChapter> lambdaQueryWrapper = new LambdaQueryWrapper<>();
|
|
||||||
lambdaQueryWrapper.in(CourseChapter::getCourseId, ids);
|
|
||||||
courseChapterService.remove(lambdaQueryWrapper);
|
|
||||||
return ResultUtils.success(true);
|
return ResultUtils.success(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -33,8 +33,11 @@ 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.*;
|
import java.util.*;
|
||||||
@ -68,12 +71,6 @@ public class ProjectCommissionController {
|
|||||||
@Resource
|
@Resource
|
||||||
private UserInfoService userInfoService;
|
private UserInfoService userInfoService;
|
||||||
|
|
||||||
@Resource
|
|
||||||
private UserMainInfoService userMainInfoService;
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 小程序用户查看查询项目的抽佣情况
|
* 小程序用户查看查询项目的抽佣情况
|
||||||
@ -138,6 +135,16 @@ public class ProjectCommissionController {
|
|||||||
return ResultUtils.success(projectCommissionVOList);
|
return ResultUtils.success(projectCommissionVOList);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// 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);
|
||||||
|
// }
|
||||||
|
|
||||||
|
|
||||||
//
|
//
|
||||||
// /**
|
// /**
|
||||||
// * 小程序用户修改项目的抽佣比例
|
// * 小程序用户修改项目的抽佣比例
|
||||||
|
@ -15,6 +15,7 @@ import com.greenorange.promotion.model.dto.projectDetail.ProjectDetailAddRequest
|
|||||||
import com.greenorange.promotion.model.dto.projectDetail.ProjectDetailUpdateRequest;
|
import com.greenorange.promotion.model.dto.projectDetail.ProjectDetailUpdateRequest;
|
||||||
import com.greenorange.promotion.model.dto.subUserProjectCommission.SubUserProjectCommissionAddRequest;
|
import com.greenorange.promotion.model.dto.subUserProjectCommission.SubUserProjectCommissionAddRequest;
|
||||||
import com.greenorange.promotion.model.entity.*;
|
import com.greenorange.promotion.model.entity.*;
|
||||||
|
import com.greenorange.promotion.model.enums.UserRoleEnum;
|
||||||
import com.greenorange.promotion.model.vo.projectDetail.ProjectDetailVO;
|
import com.greenorange.promotion.model.vo.projectDetail.ProjectDetailVO;
|
||||||
import com.greenorange.promotion.service.common.CommonService;
|
import com.greenorange.promotion.service.common.CommonService;
|
||||||
import com.greenorange.promotion.service.project.ProjectCommissionService;
|
import com.greenorange.promotion.service.project.ProjectCommissionService;
|
||||||
@ -92,7 +93,9 @@ public class ProjectDetailController {
|
|||||||
projectService.updateById(project);
|
projectService.updateById(project);
|
||||||
|
|
||||||
// 获取所有的小程序用户
|
// 获取所有的小程序用户
|
||||||
List<UserInfo> userInfoList = commonService.findByFieldEqTargetField(UserInfo::getUserRole, UserConstant.DEFAULT_ROLE, userInfoService);
|
LambdaQueryWrapper<UserInfo> miniUserInfoQueryWrapper = userInfoService.getMiniUserInfoQueryWrapper();
|
||||||
|
List<UserInfo> userInfoList = userInfoService.list(miniUserInfoQueryWrapper);
|
||||||
|
|
||||||
List<UserMainInfo> userMainInfoList = commonService.findByFieldInTargetField(userInfoList, userMainInfoService, UserInfo::getId, UserMainInfo::getUserId);
|
List<UserMainInfo> userMainInfoList = commonService.findByFieldInTargetField(userInfoList, userMainInfoService, UserInfo::getId, UserMainInfo::getUserId);
|
||||||
// 封装Map(键:用户id, 值:抽佣比例)
|
// 封装Map(键:用户id, 值:抽佣比例)
|
||||||
Map<Long, BigDecimal> userCommissionRateMap = new HashMap<>();
|
Map<Long, BigDecimal> userCommissionRateMap = new HashMap<>();
|
||||||
|
@ -2,6 +2,7 @@ package com.greenorange.promotion.controller.projectSettlement;
|
|||||||
|
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||||
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
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;
|
||||||
@ -11,7 +12,10 @@ import com.greenorange.promotion.constant.UserConstant;
|
|||||||
import com.greenorange.promotion.exception.ThrowUtils;
|
import com.greenorange.promotion.exception.ThrowUtils;
|
||||||
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.*;
|
import com.greenorange.promotion.model.entity.FundsChange;
|
||||||
|
import com.greenorange.promotion.model.entity.UserAccount;
|
||||||
|
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.userAccount.UserAccountConditionVO;
|
||||||
@ -20,17 +24,15 @@ 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.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.Resource;
|
import jakarta.annotation.Resource;
|
||||||
import jakarta.servlet.http.HttpServletRequest;
|
import jakarta.servlet.http.HttpServletRequest;
|
||||||
|
import jakarta.validation.Valid;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.springframework.web.bind.annotation.PostMapping;
|
import org.springframework.web.bind.annotation.PostMapping;
|
||||||
import org.springframework.web.bind.annotation.RequestBody;
|
import org.springframework.web.bind.annotation.RequestBody;
|
||||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
||||||
import jakarta.validation.Valid;
|
|
||||||
import org.springframework.web.bind.annotation.RequestMapping;
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
import org.springframework.web.bind.annotation.RestController;
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
|
|
||||||
@ -60,9 +62,6 @@ public class WithdrawalApplyController {
|
|||||||
@Resource
|
@Resource
|
||||||
private UserMainInfoService userMainInfoService;
|
private UserMainInfoService userMainInfoService;
|
||||||
|
|
||||||
@Resource
|
|
||||||
private UserInfoService userInfoService;
|
|
||||||
|
|
||||||
@Resource
|
@Resource
|
||||||
private UserAccountService userAccountService;
|
private UserAccountService userAccountService;
|
||||||
|
|
||||||
|
@ -0,0 +1,219 @@
|
|||||||
|
package com.greenorange.promotion.controller.userInfo;
|
||||||
|
|
||||||
|
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.ResultUtils;
|
||||||
|
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.advancementApply.*;
|
||||||
|
import com.greenorange.promotion.model.entity.AdvancementApply;
|
||||||
|
import com.greenorange.promotion.model.entity.UserInfo;
|
||||||
|
import com.greenorange.promotion.model.enums.ReviewStatusEnum;
|
||||||
|
import com.greenorange.promotion.model.enums.UserRoleEnum;
|
||||||
|
import com.greenorange.promotion.model.vo.advancementApply.AdvancementApplyApproveVO;
|
||||||
|
import com.greenorange.promotion.model.vo.advancementApply.AdvancementApplyVOPlus;
|
||||||
|
import com.greenorange.promotion.model.vo.advancementApply.AdvancementApplyVO;
|
||||||
|
import com.greenorange.promotion.service.common.CommonService;
|
||||||
|
import com.greenorange.promotion.service.userInfo.AdvancementApplyService;
|
||||||
|
import com.greenorange.promotion.service.userInfo.UserInfoService;
|
||||||
|
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;
|
||||||
|
import java.util.UUID;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 晋升申请 控制器
|
||||||
|
*/
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("advancementApply")
|
||||||
|
@Slf4j
|
||||||
|
@Tag(name = "晋升申请模块")
|
||||||
|
public class AdvancementApplyController {
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private AdvancementApplyService advancementApplyService;
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private CommonService commonService;
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private UserInfoService userInfoService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 小程序段用户添加晋升申请记录
|
||||||
|
* @param advancementApplyAddRequest 晋升申请记录添加请求体
|
||||||
|
* @return 申请记录查询凭据
|
||||||
|
*/
|
||||||
|
@PostMapping("add")
|
||||||
|
@Operation(summary = "小程序段用户添加晋升申请记录", description = "参数:晋升申请添加请求体,权限:管理员,方法名:addAdvancementApply")
|
||||||
|
@SysLog(title = "晋升申请管理", content = "小程序段用户添加晋升申请记录")
|
||||||
|
public BaseResponse<String> addAdvancementApply(@Valid @RequestBody AdvancementApplyAddRequest advancementApplyAddRequest) {
|
||||||
|
String phone = advancementApplyAddRequest.getPhone();
|
||||||
|
String verificationCode = advancementApplyAddRequest.getVerificationCode();
|
||||||
|
// 校验用户手机号和验证码
|
||||||
|
userInfoService.checkPhoneAndVerificationCode(phone, verificationCode, UserRoleEnum.STAFF);
|
||||||
|
AdvancementApply advancementApply = commonService.copyProperties(advancementApplyAddRequest, AdvancementApply.class);
|
||||||
|
advancementApply.setCredential(UUID.randomUUID().toString());
|
||||||
|
advancementApplyService.save(advancementApply);
|
||||||
|
return ResultUtils.success(advancementApply.getCredential());
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 小程序端用户撤销晋升申请记录
|
||||||
|
* @param commonRequest 晋升申请记录id
|
||||||
|
* @return 是否更新成功
|
||||||
|
*/
|
||||||
|
@PostMapping("modify/status")
|
||||||
|
@Operation(summary = "小程序端用户撤销晋升申请记录", description = "参数:晋升申请记录id,权限:管理员,方法名:revokeAdvancementApply")
|
||||||
|
@SysLog(title = "晋升申请管理", content = "小程序端用户撤销晋升申请记录")
|
||||||
|
public BaseResponse<Boolean> revokeAdvancementApply(@Valid @RequestBody CommonRequest commonRequest) {
|
||||||
|
Long id = commonRequest.getId();
|
||||||
|
LambdaUpdateWrapper<AdvancementApply> updateWrapper = new LambdaUpdateWrapper<>();
|
||||||
|
updateWrapper.eq(AdvancementApply::getId, id).set(AdvancementApply::getReviewStatus, ReviewStatusEnum.WITHDRAWN.getValue());
|
||||||
|
advancementApplyService.update(updateWrapper);
|
||||||
|
return ResultUtils.success(true);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 小程序端用户根据id修改晋升申请记录信息
|
||||||
|
* @param advancementApplyUpdateRequest 晋升申请更新请求体
|
||||||
|
* @return 是否更新成功
|
||||||
|
*/
|
||||||
|
@PostMapping("update")
|
||||||
|
@Operation(summary = "小程序端用户根据id修改晋升申请记录信息", description = "参数:晋升申请更新请求体,权限:管理员,方法名:updateAdvancementApply")
|
||||||
|
@SysLog(title = "晋升申请管理", content = "小程序端用户根据id修改晋升申请记录信息")
|
||||||
|
public BaseResponse<Boolean> updateAdvancementApply(@Valid @RequestBody AdvancementApplyUpdateRequest advancementApplyUpdateRequest) {
|
||||||
|
String phone = advancementApplyUpdateRequest.getPhone();
|
||||||
|
String verificationCode = advancementApplyUpdateRequest.getVerificationCode();
|
||||||
|
// 校验用户手机号和验证码
|
||||||
|
userInfoService.checkPhoneAndVerificationCode(phone, verificationCode, UserRoleEnum.STAFF);
|
||||||
|
AdvancementApply advancementApply = commonService.copyProperties(advancementApplyUpdateRequest, AdvancementApply.class);
|
||||||
|
advancementApplyService.updateById(advancementApply);
|
||||||
|
return ResultUtils.success(true);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 小程序端用户根据凭证(credential)查询晋升申请记录
|
||||||
|
* @param commonStringRequest 查询凭证
|
||||||
|
* @return 晋升申请记录信息
|
||||||
|
*/
|
||||||
|
@PostMapping("query/credential")
|
||||||
|
@Operation(summary = "小程序端用户根据凭证(credential)查询晋升申请记录", description = "参数:晋升申请更新请求体,权限:管理员,方法名:queryAdvancementApplyByCredential")
|
||||||
|
@SysLog(title = "晋升申请管理", content = "小程序端用户根据凭证(credential)查询晋升申请记录")
|
||||||
|
public BaseResponse<AdvancementApplyApproveVO> queryAdvancementApplyByCredential(@Valid @RequestBody CommonStringRequest commonStringRequest) {
|
||||||
|
String credential = commonStringRequest.getTemplateString();
|
||||||
|
LambdaQueryWrapper<AdvancementApply> lambdaQueryWrapper = new LambdaQueryWrapper<>();
|
||||||
|
lambdaQueryWrapper.eq(AdvancementApply::getCredential, credential);
|
||||||
|
AdvancementApply advancementApply = advancementApplyService.getOne(lambdaQueryWrapper);
|
||||||
|
AdvancementApplyApproveVO advancementApplyApproveVO = commonService.copyProperties(advancementApply, AdvancementApplyApproveVO.class);
|
||||||
|
String reviewStatus = advancementApply.getReviewStatus();
|
||||||
|
ReviewStatusEnum reviewStatusEnum = ReviewStatusEnum.getEnumByValue(reviewStatus);
|
||||||
|
// 如果审核通过,填充账号密码
|
||||||
|
if (ReviewStatusEnum.APPROVED.equals(reviewStatusEnum)) {
|
||||||
|
Long userId = advancementApply.getUserId();
|
||||||
|
UserInfo userInfo = userInfoService.getById(userId);
|
||||||
|
advancementApplyApproveVO.setUserAccount(userInfo.getUserAccount());
|
||||||
|
advancementApplyApproveVO.setUserPassword(userInfo.getUserPassword());
|
||||||
|
}
|
||||||
|
// 如果审核拒绝,填充拒绝理由
|
||||||
|
if (ReviewStatusEnum.REJECTED.equals(reviewStatusEnum)) {
|
||||||
|
advancementApplyApproveVO.setRejectReason(advancementApply.getRejectReason());
|
||||||
|
}
|
||||||
|
return ResultUtils.success(advancementApplyApproveVO);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* web端管理员批准用户的晋升申请
|
||||||
|
* @param advancementApplyApproveRequest 晋升申请等信息
|
||||||
|
* @return 晋升用户的账号密码
|
||||||
|
*/
|
||||||
|
@PostMapping("approve")
|
||||||
|
@Operation(summary = "web端管理员批准用户的晋升申请", description = "参数:晋升申请id,权限:管理员,方法名:approveAdvancementApply")
|
||||||
|
@RequiresPermission(mustRole = UserConstant.ADMIN_ROLE)
|
||||||
|
@SysLog(title = "晋升申请管理", content = "web端管理员批准用户的晋升申请")
|
||||||
|
public BaseResponse<Boolean> approveAdvancementApply(@Valid @RequestBody AdvancementApplyApproveRequest advancementApplyApproveRequest) {
|
||||||
|
userInfoService.staffUserInfoMiniRegister(advancementApplyApproveRequest);
|
||||||
|
return ResultUtils.success(true);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* web端管理员拒绝晋升申请
|
||||||
|
* @param advancementApplyRejectRequest 晋升申请拒绝请求体
|
||||||
|
* @return 晋升申请信息
|
||||||
|
*/
|
||||||
|
@PostMapping("reject")
|
||||||
|
@Operation(summary = "web端管理员拒绝晋升申请", description = "参数:晋升申请拒绝请求体,权限:管理员,方法名:rejectAdvancementApply")
|
||||||
|
@RequiresPermission(mustRole = UserConstant.ADMIN_ROLE)
|
||||||
|
@SysLog(title = "晋升申请管理", content = "web端管理员拒绝晋升申请")
|
||||||
|
public BaseResponse<Boolean> rejectAdvancementApply(@Valid @RequestBody AdvancementApplyRejectRequest advancementApplyRejectRequest) {
|
||||||
|
Long applyId = advancementApplyRejectRequest.getApplyId();
|
||||||
|
String rejectReason = advancementApplyRejectRequest.getRejectReason();
|
||||||
|
LambdaUpdateWrapper<AdvancementApply> updateWrapper = new LambdaUpdateWrapper<>();
|
||||||
|
updateWrapper.eq(AdvancementApply::getId, applyId)
|
||||||
|
.set(AdvancementApply::getReviewStatus, ReviewStatusEnum.REJECTED.getValue())
|
||||||
|
.set(AdvancementApply::getRejectReason, rejectReason);
|
||||||
|
advancementApplyService.update(updateWrapper);
|
||||||
|
return ResultUtils.success(true);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* web端管理员根据id查询晋升申请
|
||||||
|
* @param commonRequest 晋升申请id
|
||||||
|
* @return 晋升申请信息
|
||||||
|
*/
|
||||||
|
@PostMapping("queryById")
|
||||||
|
@Operation(summary = "web端管理员根据id查询晋升申请", description = "参数:晋升申请id,权限:管理员,方法名:queryAdvancementApplyById")
|
||||||
|
@RequiresPermission(mustRole = UserConstant.ADMIN_ROLE)
|
||||||
|
@SysLog(title = "晋升申请管理", content = "web端管理员根据id查询晋升申请")
|
||||||
|
public BaseResponse<AdvancementApplyVOPlus> queryAdvancementApplyById(@Valid @RequestBody CommonRequest commonRequest) {
|
||||||
|
Long id = commonRequest.getId();
|
||||||
|
AdvancementApply advancementApply = advancementApplyService.getById(id);
|
||||||
|
AdvancementApplyVOPlus advancementApplyVOPlus = commonService.copyProperties(advancementApply, AdvancementApplyVOPlus.class);
|
||||||
|
return ResultUtils.success(advancementApplyVOPlus);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Web端管理员分页查询晋升申请
|
||||||
|
* @param advancementApplyQueryRequest 晋升申请查询请求体
|
||||||
|
* @return 晋升申请列表
|
||||||
|
*/
|
||||||
|
@PostMapping("page")
|
||||||
|
@Operation(summary = "Web端管理员分页查询晋升申请", description = "参数:晋升申请查询请求体,权限:管理员,方法名:listAdvancementApplyByPage")
|
||||||
|
@RequiresPermission(mustRole = UserConstant.ADMIN_ROLE)
|
||||||
|
@SysLog(title = "晋升申请管理", content = "Web端管理员分页查询晋升申请")
|
||||||
|
public BaseResponse<Page<AdvancementApplyVO>> listAdvancementApplyByPage(@Valid @RequestBody AdvancementApplyQueryRequest advancementApplyQueryRequest) {
|
||||||
|
long current = advancementApplyQueryRequest.getCurrent();
|
||||||
|
long pageSize = advancementApplyQueryRequest.getPageSize();
|
||||||
|
QueryWrapper<AdvancementApply> queryWrapper = advancementApplyService.getQueryWrapper(advancementApplyQueryRequest);
|
||||||
|
Page<AdvancementApply> page = advancementApplyService.page(new Page<>(current, pageSize), queryWrapper);
|
||||||
|
List<AdvancementApply> advancementApplyList = page.getRecords();
|
||||||
|
List<AdvancementApplyVO> advancementApplyVOList = commonService.convertList(advancementApplyList, AdvancementApplyVO.class);
|
||||||
|
Page<AdvancementApplyVO> voPage = new Page<>(current, pageSize);
|
||||||
|
voPage.setRecords(advancementApplyVOList);
|
||||||
|
voPage.setPages(page.getPages());
|
||||||
|
voPage.setTotal(page.getTotal());
|
||||||
|
return ResultUtils.success(voPage);
|
||||||
|
}
|
||||||
|
}
|
@ -1,17 +1,11 @@
|
|||||||
package com.greenorange.promotion.controller.userInfo;
|
package com.greenorange.promotion.controller.userInfo;
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
||||||
import com.greenorange.promotion.annotation.RequiresPermission;
|
import com.greenorange.promotion.annotation.RequiresPermission;
|
||||||
import com.greenorange.promotion.annotation.SysLog;
|
|
||||||
import com.greenorange.promotion.common.BaseResponse;
|
import com.greenorange.promotion.common.BaseResponse;
|
||||||
import com.greenorange.promotion.common.ErrorCode;
|
|
||||||
import com.greenorange.promotion.common.ResultUtils;
|
import com.greenorange.promotion.common.ResultUtils;
|
||||||
import com.greenorange.promotion.constant.UserConstant;
|
import com.greenorange.promotion.constant.UserConstant;
|
||||||
import com.greenorange.promotion.exception.ThrowUtils;
|
|
||||||
import com.greenorange.promotion.model.dto.CommonBatchRequest;
|
|
||||||
import com.greenorange.promotion.model.dto.userAccount.UserAccountAddRequest;
|
import com.greenorange.promotion.model.dto.userAccount.UserAccountAddRequest;
|
||||||
import com.greenorange.promotion.model.dto.userAccount.UserAccountQueryRequest;
|
|
||||||
import com.greenorange.promotion.model.dto.userAccount.UserAccountUpdateRequest;
|
import com.greenorange.promotion.model.dto.userAccount.UserAccountUpdateRequest;
|
||||||
import com.greenorange.promotion.model.entity.UserAccount;
|
import com.greenorange.promotion.model.entity.UserAccount;
|
||||||
import com.greenorange.promotion.model.vo.userAccount.UserAccountVO;
|
import com.greenorange.promotion.model.vo.userAccount.UserAccountVO;
|
||||||
@ -21,17 +15,13 @@ import io.swagger.v3.oas.annotations.Operation;
|
|||||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||||
import jakarta.annotation.Resource;
|
import jakarta.annotation.Resource;
|
||||||
import jakarta.servlet.http.HttpServletRequest;
|
import jakarta.servlet.http.HttpServletRequest;
|
||||||
|
import jakarta.validation.Valid;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.springframework.web.bind.annotation.PostMapping;
|
import org.springframework.web.bind.annotation.PostMapping;
|
||||||
import org.springframework.web.bind.annotation.RequestBody;
|
import org.springframework.web.bind.annotation.RequestBody;
|
||||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
||||||
import com.greenorange.promotion.model.dto.CommonRequest;
|
|
||||||
import jakarta.validation.Valid;
|
|
||||||
import org.springframework.web.bind.annotation.RequestMapping;
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
import org.springframework.web.bind.annotation.RestController;
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 用户账户 控制器
|
* 用户账户 控制器
|
||||||
|
@ -113,104 +113,4 @@ public class UserMainInfoController {
|
|||||||
return ResultUtils.success(userTeamInfoVO);
|
return ResultUtils.success(userTeamInfoVO);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// /**
|
|
||||||
// * web端管理员添加用户主要信息
|
|
||||||
// * @param userMainInfoAddRequest 用户主要信息添加请求体
|
|
||||||
// * @return 是否添加成功
|
|
||||||
// */
|
|
||||||
// @PostMapping("add")
|
|
||||||
// @Operation(summary = "web端管理员添加用户主要信息", description = "参数:用户主要信息添加请求体,权限:管理员,方法名:addUserMainInfo")
|
|
||||||
// @RequiresPermission(mustRole = UserConstant.ADMIN_ROLE)
|
|
||||||
// @SysLog(title = "用户主要信息管理", content = "web端管理员添加用户主要信息")
|
|
||||||
// public BaseResponse<Boolean> addUserMainInfo(@Valid @RequestBody UserMainInfoAddRequest userMainInfoAddRequest) {
|
|
||||||
// UserMainInfo userMainInfo = commonService.copyProperties(userMainInfoAddRequest, UserMainInfo.class);
|
|
||||||
// userMainInfoService.save(userMainInfo);
|
|
||||||
// return ResultUtils.success(true);
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// /**
|
|
||||||
// * web端管理员根据id修改用户主要信息信息
|
|
||||||
// * @param userMainInfoUpdateRequest 用户主要信息更新请求体
|
|
||||||
// * @return 是否更新成功
|
|
||||||
// */
|
|
||||||
// @PostMapping("update")
|
|
||||||
// @Operation(summary = "web端管理员更新用户主要信息", description = "参数:用户主要信息更新请求体,权限:管理员,方法名:updateUserMainInfo")
|
|
||||||
// @RequiresPermission(mustRole = UserConstant.ADMIN_ROLE)
|
|
||||||
// @SysLog(title = "用户主要信息管理", content = "web端管理员根据id修改用户主要信息信息")
|
|
||||||
// public BaseResponse<Boolean> updateUserMainInfo(@Valid @RequestBody UserMainInfoUpdateRequest userMainInfoUpdateRequest) {
|
|
||||||
// UserMainInfo userMainInfo = commonService.copyProperties(userMainInfoUpdateRequest, UserMainInfo.class);
|
|
||||||
// userMainInfoService.updateById(userMainInfo);
|
|
||||||
// return ResultUtils.success(true);
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// /**
|
|
||||||
// * web端管理员根据id删除用户主要信息
|
|
||||||
// * @param commonRequest 用户主要信息删除请求体
|
|
||||||
// * @return 是否删除成功
|
|
||||||
// */
|
|
||||||
// @PostMapping("delete")
|
|
||||||
// @Operation(summary = "web端管理员根据id删除用户主要信息", description = "参数:用户主要信息删除请求体,权限:管理员,方法名:delUserMainInfo")
|
|
||||||
// @RequiresPermission(mustRole = UserConstant.ADMIN_ROLE)
|
|
||||||
// @SysLog(title = "用户主要信息管理", content = "web端管理员根据id删除用户主要信息")
|
|
||||||
// public BaseResponse<Boolean> delUserMainInfo(@Valid @RequestBody CommonRequest commonRequest) {
|
|
||||||
// Long id = commonRequest.getId();
|
|
||||||
// userMainInfoService.removeById(id);
|
|
||||||
// return ResultUtils.success(true);
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// /**
|
|
||||||
// * web端管理员批量删除用户主要信息
|
|
||||||
// * @param commonBatchRequest 用户主要信息批量删除请求体
|
|
||||||
// * @return 是否删除成功
|
|
||||||
// */
|
|
||||||
// @PostMapping("delBatch")
|
|
||||||
// @Operation(summary = "web端管理员批量删除用户主要信息", description = "参数:用户主要信息批量删除请求体,权限:管理员,方法名:delBatchUserMainInfo")
|
|
||||||
// @RequiresPermission(mustRole = UserConstant.ADMIN_ROLE)
|
|
||||||
// @SysLog(title = "用户主要信息管理", content = "web端管理员批量删除用户主要信息")
|
|
||||||
// public BaseResponse<Boolean> delBatchUserMainInfo(@Valid @RequestBody CommonBatchRequest commonBatchRequest) {
|
|
||||||
// List<Long> ids = commonBatchRequest.getIds();
|
|
||||||
// userMainInfoService.removeByIds(ids);
|
|
||||||
// return ResultUtils.success(true);
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// /**
|
|
||||||
// * web端管理员根据id查询用户主要信息
|
|
||||||
// * @param commonRequest 用户主要信息查询请求体
|
|
||||||
// * @return 用户主要信息信息
|
|
||||||
// */
|
|
||||||
// @PostMapping("queryById")
|
|
||||||
// @Operation(summary = "web端管理员根据id查询用户主要信息", description = "参数:用户主要信息查询请求体,权限:管理员,方法名:queryUserMainInfoById")
|
|
||||||
// @RequiresPermission(mustRole = UserConstant.ADMIN_ROLE)
|
|
||||||
// @SysLog(title = "用户主要信息管理", content = "web端管理员根据id查询用户主要信息")
|
|
||||||
// public BaseResponse<UserMainInfoVO> queryUserMainInfoById(@Valid @RequestBody CommonRequest commonRequest) {
|
|
||||||
// Long id = commonRequest.getId();
|
|
||||||
// UserMainInfo userMainInfo = userMainInfoService.getById(id);
|
|
||||||
// ThrowUtils.throwIf(userMainInfo == null, ErrorCode.OPERATION_ERROR, "当前用户主要信息不存在");
|
|
||||||
// UserMainInfoVO userMainInfoVO = commonService.copyProperties(userMainInfo, UserMainInfoVO.class);
|
|
||||||
// return ResultUtils.success(userMainInfoVO);
|
|
||||||
// }
|
|
||||||
|
|
||||||
// /**
|
|
||||||
// * Web端管理员分页查询用户主要信息
|
|
||||||
// * @param userMainInfoQueryRequest 用户主要信息查询请求体
|
|
||||||
// * @return 用户主要信息列表
|
|
||||||
// */
|
|
||||||
// @PostMapping("page")
|
|
||||||
// @Operation(summary = "Web端管理员分页查询用户主要信息", description = "参数:用户主要信息查询请求体,权限:管理员,方法名:listUserMainInfoByPage")
|
|
||||||
// @RequiresPermission(mustRole = UserConstant.ADMIN_ROLE)
|
|
||||||
// @SysLog(title = "用户主要信息管理", content = "Web端管理员分页查询用户主要信息")
|
|
||||||
// public BaseResponse<Page<UserMainInfoVO>> listUserMainInfoByPage(@Valid @RequestBody UserMainInfoQueryRequest userMainInfoQueryRequest) {
|
|
||||||
// long current = userMainInfoQueryRequest.getCurrent();
|
|
||||||
// long pageSize = userMainInfoQueryRequest.getPageSize();
|
|
||||||
// QueryWrapper<UserMainInfo> queryWrapper = userMainInfoService.getQueryWrapper(userMainInfoQueryRequest);
|
|
||||||
// Page<UserMainInfo> page = userMainInfoService.page(new Page<>(current, pageSize), queryWrapper);
|
|
||||||
// List<UserMainInfo> userMainInfoList = page.getRecords();
|
|
||||||
// List<UserMainInfoVO> userMainInfoVOList = commonService.convertList(userMainInfoList, UserMainInfoVO.class);
|
|
||||||
// Page<UserMainInfoVO> voPage = new Page<>(current, pageSize);
|
|
||||||
// voPage.setRecords(userMainInfoVOList);
|
|
||||||
// voPage.setPages(page.getPages());
|
|
||||||
// voPage.setTotal(page.getTotal());
|
|
||||||
// return ResultUtils.success(voPage);
|
|
||||||
// }
|
|
||||||
}
|
}
|
@ -65,19 +65,19 @@ public class WechatGetQrcodeController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
// /**
|
||||||
* 微信小程序获取课程码
|
// * 微信小程序获取课程码
|
||||||
* @return
|
// * @return
|
||||||
* @throws IOException
|
// * @throws IOException
|
||||||
*/
|
// */
|
||||||
@Hidden
|
// @Hidden
|
||||||
@PostMapping("/get/course/qrcode")
|
// @PostMapping("/get/course/qrcode")
|
||||||
@Operation(summary = "微信小程序获取课程码", description = "参数:无, 权限:所有人, 方法名:getCourseQrcode")
|
// @Operation(summary = "微信小程序获取课程码", description = "参数:无, 权限:所有人, 方法名:getCourseQrcode")
|
||||||
// @RequiresPermission(mustRole = UserConstant.DEFAULT_ROLE)
|
//// @RequiresPermission(mustRole = UserConstant.DEFAULT_ROLE)
|
||||||
public BaseResponse<String> getCourseQrcode(@Valid @RequestBody CommonRequest commonRequest, HttpServletRequest request) throws Exception {
|
// public BaseResponse<String> getCourseQrcode(@Valid @RequestBody CommonRequest commonRequest, HttpServletRequest request) throws Exception {
|
||||||
String view = wechatGetQrcodeService.getWxCourseQrCode(commonRequest, request);
|
// String view = wechatGetQrcodeService.getWxCourseQrCode(commonRequest, request);
|
||||||
return ResultUtils.success(view);
|
// return ResultUtils.success(view);
|
||||||
}
|
// }
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -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 = "CourseOrder";
|
private static final String ENTITY_NAME = "AdvancementApply";
|
||||||
// 表名
|
// 表名
|
||||||
private static final String TABLE_NAME = "course_order";
|
private static final String TABLE_NAME = "advancement_apply";
|
||||||
// 实体类属性名
|
// 实体类属性名
|
||||||
private static final String ENTITY_NAME_LOWER = "courseOrder";
|
private static final String ENTITY_NAME_LOWER = "advancementApply";
|
||||||
|
|
||||||
// 父包名
|
// 父包名
|
||||||
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.AdvancementApply;
|
||||||
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author 35880
|
||||||
|
* @description 针对表【advancement_apply(晋升申请表)】的数据库操作Mapper
|
||||||
|
* @createDate 2025-06-29 12:39:54
|
||||||
|
* @Entity com.greenorange.promotion.model.entity.AdvancementApply
|
||||||
|
*/
|
||||||
|
public interface AdvancementApplyMapper extends BaseMapper<AdvancementApply> {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -1,18 +0,0 @@
|
|||||||
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> {
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -1,18 +0,0 @@
|
|||||||
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> {
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -1,18 +0,0 @@
|
|||||||
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,54 @@
|
|||||||
|
package com.greenorange.promotion.model.dto.advancementApply;
|
||||||
|
|
||||||
|
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",
|
||||||
|
"verificationCode"
|
||||||
|
})
|
||||||
|
public class AdvancementApplyAddRequest implements Serializable {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 申请人姓名
|
||||||
|
*/
|
||||||
|
@NotBlank(message = "申请人姓名不能为空")
|
||||||
|
@Schema(description = "申请人姓名", example = "张三")
|
||||||
|
private String name;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 申请人手机号
|
||||||
|
*/
|
||||||
|
@NotBlank(message = "申请人手机号不能为空")
|
||||||
|
@Schema(description = "申请人手机号", example = "15888610253")
|
||||||
|
private String phone;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 验证码
|
||||||
|
*/
|
||||||
|
@NotBlank(message = "验证码不能为空")
|
||||||
|
@Schema(description = "验证码", example = "666999")
|
||||||
|
private String verificationCode;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 简历(view值)
|
||||||
|
*/
|
||||||
|
@NotBlank(message = "简历(view值)不能为空")
|
||||||
|
@Schema(description = "简历(view值)", example = "D89SKF3N")
|
||||||
|
private String resume;
|
||||||
|
|
||||||
|
|
||||||
|
@Serial
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,49 @@
|
|||||||
|
package com.greenorange.promotion.model.dto.advancementApply;
|
||||||
|
|
||||||
|
import com.greenorange.promotion.annotation.EnumValue;
|
||||||
|
import com.greenorange.promotion.model.enums.UserRoleEnum;
|
||||||
|
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 = {
|
||||||
|
"applyId",
|
||||||
|
"invitationCode",
|
||||||
|
"userRole"
|
||||||
|
})
|
||||||
|
public class AdvancementApplyApproveRequest implements Serializable {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 晋升申请id
|
||||||
|
*/
|
||||||
|
@Min(value = 1, message = "晋升申请id不能小于1")
|
||||||
|
@Schema(description = "晋升申请id", example = "1")
|
||||||
|
private Long applyId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 邀请码
|
||||||
|
*/
|
||||||
|
@NotBlank(message = "邀请码不能为空")
|
||||||
|
@Schema(description = "邀请码", example = "666999")
|
||||||
|
private String invitationCode;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 用户角色
|
||||||
|
*/
|
||||||
|
@NotBlank(message = "用户角色不能为空")
|
||||||
|
@EnumValue(enumClass = UserRoleEnum.class)
|
||||||
|
@Schema(description = "用户角色", example = "user")
|
||||||
|
private String userRole;
|
||||||
|
|
||||||
|
|
||||||
|
@Serial
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
}
|
@ -0,0 +1,42 @@
|
|||||||
|
package com.greenorange.promotion.model.dto.advancementApply;
|
||||||
|
|
||||||
|
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;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 晋升申请查询请求体,继承自分页请求 PageRequest
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@Schema(description = "晋升申请查询请求体", requiredProperties = {"current", "pageSize"})
|
||||||
|
public class AdvancementApplyQueryRequest extends PageRequest implements Serializable {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 申请人姓名
|
||||||
|
*/
|
||||||
|
@Schema(description = "申请人姓名", example = "张三")
|
||||||
|
private String name;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 申请人手机号
|
||||||
|
*/
|
||||||
|
@Schema(description = "申请人手机号", example = "15888610253")
|
||||||
|
private String phone;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 审核状态
|
||||||
|
*/
|
||||||
|
@Schema(description = "审核状态", example = "待审核")
|
||||||
|
private String reviewStatus;
|
||||||
|
|
||||||
|
|
||||||
|
@Serial
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,40 @@
|
|||||||
|
package com.greenorange.promotion.model.dto.advancementApply;
|
||||||
|
|
||||||
|
import com.greenorange.promotion.annotation.EnumValue;
|
||||||
|
import com.greenorange.promotion.model.enums.UserRoleEnum;
|
||||||
|
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 = {
|
||||||
|
"applyId",
|
||||||
|
"rejectReason"
|
||||||
|
})
|
||||||
|
public class AdvancementApplyRejectRequest implements Serializable {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 晋升申请id
|
||||||
|
*/
|
||||||
|
@Min(value = 1, message = "晋升申请id不能小于1")
|
||||||
|
@Schema(description = "晋升申请id", example = "1")
|
||||||
|
private Long applyId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 拒绝理由
|
||||||
|
*/
|
||||||
|
@NotBlank(message = "拒绝理由不能为空")
|
||||||
|
@Schema(description = "拒绝理由", example = "拒绝理由")
|
||||||
|
private String rejectReason;
|
||||||
|
|
||||||
|
|
||||||
|
@Serial
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
}
|
@ -0,0 +1,71 @@
|
|||||||
|
package com.greenorange.promotion.model.dto.advancementApply;
|
||||||
|
|
||||||
|
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",
|
||||||
|
"phone",
|
||||||
|
"verificationCode",
|
||||||
|
"resume",
|
||||||
|
"reviewStatus",
|
||||||
|
})
|
||||||
|
public class AdvancementApplyUpdateRequest implements Serializable {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 晋升申请id
|
||||||
|
*/
|
||||||
|
@Min(value = 1L, message = "晋升申请id ID不能小于1")
|
||||||
|
@Schema(description = "晋升申请id", example = "张三")
|
||||||
|
private Long id;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 申请人姓名
|
||||||
|
*/
|
||||||
|
@NotBlank(message = "申请人姓名不能为空")
|
||||||
|
@Schema(description = "申请人姓名", example = "")
|
||||||
|
private String name;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 申请人手机号
|
||||||
|
*/
|
||||||
|
@NotBlank(message = "申请人手机号不能为空")
|
||||||
|
@Schema(description = "申请人手机号", example = "15888610253")
|
||||||
|
private String phone;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 验证码
|
||||||
|
*/
|
||||||
|
@NotBlank(message = "验证码不能为空")
|
||||||
|
@Schema(description = "验证码", example = "666999")
|
||||||
|
private String verificationCode;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 简历(view值)
|
||||||
|
*/
|
||||||
|
@NotBlank(message = "简历(view值)不能为空")
|
||||||
|
@Schema(description = "简历(view值)", example = "3DFK2K3J")
|
||||||
|
private String resume;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 审核状态
|
||||||
|
*/
|
||||||
|
@NotBlank(message = "审核状态不能为空")
|
||||||
|
@Schema(description = "审核状态", example = "待审核")
|
||||||
|
private String reviewStatus;
|
||||||
|
|
||||||
|
|
||||||
|
@Serial
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
}
|
@ -19,12 +19,9 @@ import java.io.Serializable;
|
|||||||
"name",
|
"name",
|
||||||
"type",
|
"type",
|
||||||
"detail",
|
"detail",
|
||||||
"promoCodeDesc",
|
|
||||||
"image",
|
"image",
|
||||||
"originPrice",
|
"originPrice",
|
||||||
"discountPrice",
|
"discountPrice"
|
||||||
"firstLevelRate",
|
|
||||||
"secondLevelRate",
|
|
||||||
})
|
})
|
||||||
public class CourseAddRequest implements Serializable {
|
public class CourseAddRequest implements Serializable {
|
||||||
|
|
||||||
@ -36,11 +33,11 @@ public class CourseAddRequest implements Serializable {
|
|||||||
private String name;
|
private String name;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 课程类别[考公考研,自媒体,财经]
|
* 课程类别[考公,财经]
|
||||||
*/
|
*/
|
||||||
@NotBlank(message = "课程类别不能为空")
|
@NotBlank(message = "课程类别不能为空")
|
||||||
@EnumValue(enumClass = CourseTypeEnum.class)
|
@EnumValue(enumClass = CourseTypeEnum.class)
|
||||||
@Schema(description = "课程类别[考公考研,自媒体,财经]", example = "自媒体")
|
@Schema(description = "课程类别[考公,财经]", example = "自媒体")
|
||||||
private String type;
|
private String type;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -50,13 +47,6 @@ public class CourseAddRequest implements Serializable {
|
|||||||
@Schema(description = "课程概述(富文本)", example = "富文本")
|
@Schema(description = "课程概述(富文本)", example = "富文本")
|
||||||
private String detail;
|
private String detail;
|
||||||
|
|
||||||
/**
|
|
||||||
* 推广码说明(富文本)
|
|
||||||
*/
|
|
||||||
@NotBlank(message = "推广码说明(富文本)不能为空")
|
|
||||||
@Schema(description = "推广码说明(富文本)", example = "富文本")
|
|
||||||
private String promoCodeDesc;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 课程图片URL
|
* 课程图片URL
|
||||||
*/
|
*/
|
||||||
@ -78,20 +68,6 @@ public class CourseAddRequest implements Serializable {
|
|||||||
@Schema(description = "折扣价格", example = "2499")
|
@Schema(description = "折扣价格", example = "2499")
|
||||||
private BigDecimal discountPrice;
|
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
|
@Serial
|
||||||
private static final long serialVersionUID = 1L;
|
private static final long serialVersionUID = 1L;
|
||||||
|
@ -28,10 +28,10 @@ public class CourseQueryRequest extends PageRequest implements Serializable {
|
|||||||
private String name;
|
private String name;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 课程类别[考公考研,自媒体,财经]
|
* 课程类别[考公,财经]
|
||||||
*/
|
*/
|
||||||
@EnumValue(enumClass = CourseTypeEnum.class)
|
@EnumValue(enumClass = CourseTypeEnum.class)
|
||||||
@Schema(description = "课程类别[考公考研,自媒体,财经]", example = "自媒体")
|
@Schema(description = "课程类别[考公,财经]", example = "自媒体")
|
||||||
private String type;
|
private String type;
|
||||||
|
|
||||||
|
|
||||||
|
@ -22,13 +22,10 @@ import java.io.Serializable;
|
|||||||
"name",
|
"name",
|
||||||
"type",
|
"type",
|
||||||
"detail",
|
"detail",
|
||||||
"promoCodeDesc",
|
|
||||||
"image",
|
"image",
|
||||||
"originPrice",
|
"originPrice",
|
||||||
"discountPrice",
|
"discountPrice",
|
||||||
"orderCount",
|
"orderCount"
|
||||||
"firstLevelRate",
|
|
||||||
"secondLevelRate",
|
|
||||||
})
|
})
|
||||||
public class CourseUpdateRequest implements Serializable {
|
public class CourseUpdateRequest implements Serializable {
|
||||||
|
|
||||||
@ -47,11 +44,11 @@ public class CourseUpdateRequest implements Serializable {
|
|||||||
private String name;
|
private String name;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 课程类别[考公考研,自媒体,财经]
|
* 课程类别[考公,财经]
|
||||||
*/
|
*/
|
||||||
@NotBlank(message = "课程类别不能为空")
|
@NotBlank(message = "课程类别不能为空")
|
||||||
@EnumValue(enumClass = CourseTypeEnum.class)
|
@EnumValue(enumClass = CourseTypeEnum.class)
|
||||||
@Schema(description = "课程类别[考公考研,自媒体,财经]", example = "自媒体")
|
@Schema(description = "课程类别[考公,财经]", example = "自媒体")
|
||||||
private String type;
|
private String type;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -61,13 +58,6 @@ public class CourseUpdateRequest implements Serializable {
|
|||||||
@Schema(description = "课程概述(富文本)", example = "富文本")
|
@Schema(description = "课程概述(富文本)", example = "富文本")
|
||||||
private String detail;
|
private String detail;
|
||||||
|
|
||||||
/**
|
|
||||||
* 推广码说明(富文本)
|
|
||||||
*/
|
|
||||||
@NotBlank(message = "推广码说明(富文本)不能为空")
|
|
||||||
@Schema(description = "推广码说明(富文本)", example = "富文本")
|
|
||||||
private String promoCodeDesc;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 课程图片URL
|
* 课程图片URL
|
||||||
*/
|
*/
|
||||||
@ -95,20 +85,6 @@ public class CourseUpdateRequest implements Serializable {
|
|||||||
@Schema(description = "已下单人数", example = "100")
|
@Schema(description = "已下单人数", example = "100")
|
||||||
private Integer orderCount;
|
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
|
@Serial
|
||||||
private static final long serialVersionUID = 1L;
|
private static final long serialVersionUID = 1L;
|
||||||
|
@ -1,67 +0,0 @@
|
|||||||
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;
|
|
||||||
}
|
|
||||||
|
|
@ -1,48 +0,0 @@
|
|||||||
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;
|
|
||||||
}
|
|
||||||
|
|
@ -1,74 +0,0 @@
|
|||||||
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;
|
|
||||||
}
|
|
@ -4,7 +4,10 @@ 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.Pattern;
|
||||||
import jakarta.validation.constraints.Size;
|
import jakarta.validation.constraints.Size;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Builder;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
import java.io.Serial;
|
import java.io.Serial;
|
||||||
import java.io.Serializable;
|
import java.io.Serializable;
|
||||||
|
@ -3,7 +3,10 @@ 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.Size;
|
import jakarta.validation.constraints.Size;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Builder;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
import java.io.Serial;
|
import java.io.Serial;
|
||||||
import java.io.Serializable;
|
import java.io.Serializable;
|
||||||
|
@ -4,49 +4,57 @@ import com.baomidou.mybatisplus.annotation.IdType;
|
|||||||
import com.baomidou.mybatisplus.annotation.TableField;
|
import com.baomidou.mybatisplus.annotation.TableField;
|
||||||
import com.baomidou.mybatisplus.annotation.TableId;
|
import com.baomidou.mybatisplus.annotation.TableId;
|
||||||
import com.baomidou.mybatisplus.annotation.TableName;
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
|
|
||||||
import java.io.Serial;
|
|
||||||
import java.io.Serializable;
|
import java.io.Serializable;
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 课程章节表
|
* 晋升申请表
|
||||||
* @TableName course_chapter
|
* @TableName advancement_apply
|
||||||
*/
|
*/
|
||||||
@TableName(value ="course_chapter")
|
@TableName(value ="advancement_apply")
|
||||||
@Data
|
@Data
|
||||||
public class CourseChapter implements Serializable {
|
public class AdvancementApply implements Serializable {
|
||||||
/**
|
/**
|
||||||
* 章节ID
|
* 晋升申请id
|
||||||
*/
|
*/
|
||||||
@TableId(type = IdType.AUTO)
|
@TableId(type = IdType.AUTO)
|
||||||
private Long id;
|
private Long id;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 章节名称
|
* 申请人姓名
|
||||||
*/
|
*/
|
||||||
private String name;
|
private String name;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 章节时长(格式可自定义,如"00:10:00")
|
* 申请人手机号
|
||||||
*/
|
*/
|
||||||
private Long duration;
|
private String phone;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 试看权限[全集试看,部分试看,关闭,开启]
|
* 简历
|
||||||
*/
|
*/
|
||||||
private String permissions;
|
private String resume;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 视频文件 view 值
|
* 查询凭证
|
||||||
*/
|
*/
|
||||||
private String videoView;
|
private String credential;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 所属课程ID
|
* 审核状态
|
||||||
*/
|
*/
|
||||||
private Long courseId;
|
private String reviewStatus;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 拒绝理由
|
||||||
|
*/
|
||||||
|
private String rejectReason;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 用户id(申请成功后获得)
|
||||||
|
*/
|
||||||
|
private Long userId;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 是否删除
|
* 是否删除
|
||||||
@ -63,7 +71,6 @@ public class CourseChapter implements Serializable {
|
|||||||
*/
|
*/
|
||||||
private Date updateTime;
|
private Date updateTime;
|
||||||
|
|
||||||
@Serial
|
|
||||||
@TableField(exist = false)
|
@TableField(exist = false)
|
||||||
private static final long serialVersionUID = 1L;
|
private static final long serialVersionUID = 1L;
|
||||||
}
|
}
|
@ -28,7 +28,7 @@ public class Course implements Serializable {
|
|||||||
private String name;
|
private String name;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 课程类别[考公考研,自媒体,财经]
|
* 课程类别[考公,财经]
|
||||||
*/
|
*/
|
||||||
private String type;
|
private String type;
|
||||||
|
|
||||||
@ -37,11 +37,6 @@ public class Course implements Serializable {
|
|||||||
*/
|
*/
|
||||||
private String detail;
|
private String detail;
|
||||||
|
|
||||||
/**
|
|
||||||
* 推广码说明(富文本)
|
|
||||||
*/
|
|
||||||
private String promoCodeDesc;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 课程图片URL
|
* 课程图片URL
|
||||||
*/
|
*/
|
||||||
@ -62,16 +57,6 @@ public class Course implements Serializable {
|
|||||||
*/
|
*/
|
||||||
private Integer orderCount;
|
private Integer orderCount;
|
||||||
|
|
||||||
/**
|
|
||||||
* 一级佣金比例(%)
|
|
||||||
*/
|
|
||||||
private BigDecimal firstLevelRate;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 二级佣金比例(%)
|
|
||||||
*/
|
|
||||||
private BigDecimal secondLevelRate;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 是否上架(true:上架,false:下架)
|
* 是否上架(true:上架,false:下架)
|
||||||
*/
|
*/
|
||||||
|
@ -1,63 +0,0 @@
|
|||||||
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;
|
|
||||||
}
|
|
@ -1,82 +0,0 @@
|
|||||||
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;
|
|
||||||
}
|
|
@ -18,6 +18,9 @@ import lombok.NoArgsConstructor;
|
|||||||
*/
|
*/
|
||||||
@TableName(value ="user_info")
|
@TableName(value ="user_info")
|
||||||
@Data
|
@Data
|
||||||
|
@NoArgsConstructor
|
||||||
|
@AllArgsConstructor
|
||||||
|
@Builder
|
||||||
public class UserInfo implements Serializable {
|
public class UserInfo implements Serializable {
|
||||||
/**
|
/**
|
||||||
* 用户ID
|
* 用户ID
|
||||||
|
@ -14,8 +14,7 @@ import java.util.stream.Collectors;
|
|||||||
@Getter
|
@Getter
|
||||||
public enum CourseTypeEnum implements BaseEnum {
|
public enum CourseTypeEnum implements BaseEnum {
|
||||||
|
|
||||||
KAOGONGKAOYAN("考公考研"),
|
KAOGONG("考公"),
|
||||||
ZIMEITI("自媒体"),
|
|
||||||
CAIJING("财经");
|
CAIJING("财经");
|
||||||
|
|
||||||
private final String value;
|
private final String 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 ReviewStatusEnum implements BaseEnum {
|
||||||
|
|
||||||
|
PENDING("待审核"),
|
||||||
|
APPROVED("已通过"),
|
||||||
|
REJECTED("已拒绝"),
|
||||||
|
WITHDRAWN("已撤回");
|
||||||
|
|
||||||
|
private final String value;
|
||||||
|
|
||||||
|
ReviewStatusEnum(String value) {
|
||||||
|
this.value = value;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* BaseEnum 要求的方法:返回枚举对应的校验值
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public String getValue() {
|
||||||
|
return this.value;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取所有枚举值列表
|
||||||
|
*/
|
||||||
|
public static List<String> getValues() {
|
||||||
|
return Arrays.stream(values())
|
||||||
|
.map(ReviewStatusEnum::getValue)
|
||||||
|
.collect(Collectors.toList());
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据值获取对应的枚举对象
|
||||||
|
*/
|
||||||
|
public static ReviewStatusEnum getEnumByValue(String value) {
|
||||||
|
if (StringUtils.isBlank(value)) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
for (ReviewStatusEnum status : ReviewStatusEnum.values()) {
|
||||||
|
if (status.value.equals(value)) {
|
||||||
|
return status;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
}
|
@ -18,7 +18,10 @@ public enum UserRoleEnum implements BaseEnum {
|
|||||||
USER("用户", "user"),
|
USER("用户", "user"),
|
||||||
ADMIN("管理员", "admin"),
|
ADMIN("管理员", "admin"),
|
||||||
BOSS("Boss", "boss"),
|
BOSS("Boss", "boss"),
|
||||||
BAN("被封号", "ban");
|
BAN("被封号", "ban"),
|
||||||
|
MANAGER("经理", "manager"),
|
||||||
|
SUPERVISOR("主管", "supervisor"),
|
||||||
|
STAFF("员工", "staff");
|
||||||
|
|
||||||
|
|
||||||
private final String text;
|
private final String text;
|
||||||
|
@ -0,0 +1,57 @@
|
|||||||
|
package com.greenorange.promotion.model.vo.advancementApply;
|
||||||
|
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.io.Serial;
|
||||||
|
import java.io.Serializable;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 晋升申请审核结果 视图对象
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@Schema(description = "晋升申请审核结果 视图对象")
|
||||||
|
public class AdvancementApplyApproveVO implements Serializable {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 申请人姓名
|
||||||
|
*/
|
||||||
|
@Schema(description = "申请人姓名", example = "张三")
|
||||||
|
private String name;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 申请人手机号
|
||||||
|
*/
|
||||||
|
@Schema(description = "申请人手机号", example = "15888610253")
|
||||||
|
private String phone;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 审核状态
|
||||||
|
*/
|
||||||
|
@Schema(description = "审核状态", example = "待审核")
|
||||||
|
private String reviewStatus;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 拒绝理由
|
||||||
|
*/
|
||||||
|
@Schema(description = "拒绝理由", example = "无")
|
||||||
|
private String rejectReason;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 账号
|
||||||
|
*/
|
||||||
|
@Schema(description = "账号", example = "qingcheng")
|
||||||
|
private String userAccount;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 密码(建议加密存储)
|
||||||
|
*/
|
||||||
|
@Schema(description = "密码(建议加密存储)", example = "qingcheng")
|
||||||
|
private String userPassword;
|
||||||
|
|
||||||
|
|
||||||
|
@Serial
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,64 @@
|
|||||||
|
package com.greenorange.promotion.model.vo.advancementApply;
|
||||||
|
|
||||||
|
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;
|
||||||
|
import java.util.UUID;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 晋升申请 视图对象
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@Schema(description = "晋升申请 视图对象")
|
||||||
|
public class AdvancementApplyVO implements Serializable {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 晋升申请ID
|
||||||
|
*/
|
||||||
|
@Schema(description = "晋升申请ID", example = "1")
|
||||||
|
private Long id;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 申请人姓名
|
||||||
|
*/
|
||||||
|
@Schema(description = "申请人姓名", example = "张三")
|
||||||
|
private String name;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 申请人手机号
|
||||||
|
*/
|
||||||
|
@Schema(description = "申请人手机号", example = "15888610253")
|
||||||
|
private String phone;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 简历(view值)
|
||||||
|
*/
|
||||||
|
@Schema(description = "简历(view值)", example = "32DK8DKL8")
|
||||||
|
private String resume;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询凭证
|
||||||
|
*/
|
||||||
|
@Schema(description = "查询凭证", example = "cef281c7-578f-4cc9-aca9-f1b5f6bcacb1")
|
||||||
|
private String credential;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 审核状态
|
||||||
|
*/
|
||||||
|
@Schema(description = "审核状态", example = "待审核")
|
||||||
|
private String reviewStatus;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 创建时间
|
||||||
|
*/
|
||||||
|
@Schema(description = "创建时间", example = "2023-03-01 00:00:00")
|
||||||
|
private Date createTime;
|
||||||
|
|
||||||
|
|
||||||
|
@Serial
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
}
|
@ -0,0 +1,64 @@
|
|||||||
|
package com.greenorange.promotion.model.vo.advancementApply;
|
||||||
|
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 晋升申请记录(id查询) 视图对象
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@Schema(description = "晋升申请记录(id查询) 视图对象")
|
||||||
|
public class AdvancementApplyVOPlus implements Serializable {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 晋升申请ID
|
||||||
|
*/
|
||||||
|
@Schema(description = "晋升申请ID", example = "1")
|
||||||
|
private Long id;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 申请人姓名
|
||||||
|
*/
|
||||||
|
@Schema(description = "申请人姓名", example = "张三")
|
||||||
|
private String name;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 申请人手机号
|
||||||
|
*/
|
||||||
|
@Schema(description = "申请人手机号", example = "15888610253")
|
||||||
|
private String phone;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 简历(view值)
|
||||||
|
*/
|
||||||
|
@Schema(description = "简历(view值)", example = "32DK8DKL8")
|
||||||
|
private String resume;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询凭证
|
||||||
|
*/
|
||||||
|
@Schema(description = "查询凭证", example = "cef281c7-578f-4cc9-aca9-f1b5f6bcacb1")
|
||||||
|
private String credential;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 审核状态
|
||||||
|
*/
|
||||||
|
@Schema(description = "审核状态", example = "待审核")
|
||||||
|
private String reviewStatus;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 拒绝理由
|
||||||
|
*/
|
||||||
|
@Schema(description = "拒绝理由", example = "无")
|
||||||
|
private String rejectReason;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 创建时间
|
||||||
|
*/
|
||||||
|
@Schema(description = "创建时间", example = "2023-03-01 00:00:00")
|
||||||
|
private Date createTime;
|
||||||
|
|
||||||
|
}
|
@ -24,9 +24,9 @@ public class CourseCardVO implements Serializable {
|
|||||||
private String name;
|
private String name;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 课程类别[考公考研,自媒体,财经]
|
* 课程类别[考公,财经]
|
||||||
*/
|
*/
|
||||||
@Schema(description = "课程类别[考公考研,自媒体,财经]", example = "自媒体")
|
@Schema(description = "课程类别[考公,财经]", example = "自媒体")
|
||||||
private String type;
|
private String type;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -1,13 +1,11 @@
|
|||||||
package com.greenorange.promotion.model.vo.course;
|
package com.greenorange.promotion.model.vo.course;
|
||||||
|
|
||||||
import com.greenorange.promotion.model.vo.courseChapter.CourseChapterVO;
|
|
||||||
import io.swagger.v3.oas.annotations.media.Schema;
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
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.math.BigDecimal;
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
|
|
||||||
@Data
|
@Data
|
||||||
@ -27,9 +25,9 @@ public class CourseDetailVO implements Serializable {
|
|||||||
private String name;
|
private String name;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 课程类别[考公考研,自媒体,财经]
|
* 课程类别[考公,财经]
|
||||||
*/
|
*/
|
||||||
@Schema(description = "课程类别[考公考研,自媒体,财经]", example = "自媒体")
|
@Schema(description = "课程类别[考公,财经]", example = "自媒体")
|
||||||
private String type;
|
private String type;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -38,12 +36,6 @@ public class CourseDetailVO implements Serializable {
|
|||||||
@Schema(description = "课程概述(富文本)", example = "富文本")
|
@Schema(description = "课程概述(富文本)", example = "富文本")
|
||||||
private String detail;
|
private String detail;
|
||||||
|
|
||||||
/**
|
|
||||||
* 推广码说明(富文本)
|
|
||||||
*/
|
|
||||||
@Schema(description = "推广码说明(富文本)", example = "富文本")
|
|
||||||
private String promoCodeDesc;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 课程图片URL
|
* 课程图片URL
|
||||||
*/
|
*/
|
||||||
@ -62,12 +54,6 @@ public class CourseDetailVO implements Serializable {
|
|||||||
@Schema(description = "折扣价格", example = "2499")
|
@Schema(description = "折扣价格", example = "2499")
|
||||||
private BigDecimal discountPrice;
|
private BigDecimal discountPrice;
|
||||||
|
|
||||||
/**
|
|
||||||
* 课程章节
|
|
||||||
*/
|
|
||||||
@Schema(description = "课程章节")
|
|
||||||
private List<CourseChapterVO> courseChapters;
|
|
||||||
|
|
||||||
|
|
||||||
@Serial
|
@Serial
|
||||||
private static final long serialVersionUID = 1L;
|
private static final long serialVersionUID = 1L;
|
||||||
|
@ -27,9 +27,9 @@ public class CourseVO implements Serializable {
|
|||||||
private String name;
|
private String name;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 课程类别[考公考研,自媒体,财经]
|
* 课程类别[考公,财经]
|
||||||
*/
|
*/
|
||||||
@Schema(description = "课程类别[考公考研,自媒体,财经]", example = "自媒体")
|
@Schema(description = "课程类别[考公,财经]", example = "自媒体")
|
||||||
private String type;
|
private String type;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -38,12 +38,6 @@ public class CourseVO implements Serializable {
|
|||||||
@Schema(description = "课程概述(富文本)", example = "富文本")
|
@Schema(description = "课程概述(富文本)", example = "富文本")
|
||||||
private String detail;
|
private String detail;
|
||||||
|
|
||||||
/**
|
|
||||||
* 推广码说明(富文本)
|
|
||||||
*/
|
|
||||||
@Schema(description = "推广码说明(富文本)", example = "富文本")
|
|
||||||
private String promoCodeDesc;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 课程图片URL
|
* 课程图片URL
|
||||||
*/
|
*/
|
||||||
@ -68,18 +62,6 @@ public class CourseVO implements Serializable {
|
|||||||
@Schema(description = "已下单人数", example = "100")
|
@Schema(description = "已下单人数", example = "100")
|
||||||
private Integer orderCount;
|
private Integer orderCount;
|
||||||
|
|
||||||
/**
|
|
||||||
* 一级佣金比例(%)
|
|
||||||
*/
|
|
||||||
@Schema(description = "一级佣金比例(%)", example = "10")
|
|
||||||
private BigDecimal firstLevelRate;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 二级佣金比例(%)
|
|
||||||
*/
|
|
||||||
@Schema(description = "二级佣金比例(%)", example = "5")
|
|
||||||
private BigDecimal secondLevelRate;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 是否上架(true:上架,false:下架)
|
* 是否上架(true:上架,false:下架)
|
||||||
*/
|
*/
|
||||||
|
@ -1,58 +0,0 @@
|
|||||||
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;
|
|
||||||
}
|
|
@ -1,20 +0,0 @@
|
|||||||
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);
|
|
||||||
}
|
|
@ -1,13 +0,0 @@
|
|||||||
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> {
|
|
||||||
|
|
||||||
}
|
|
@ -1,13 +0,0 @@
|
|||||||
package com.greenorange.promotion.service.course;
|
|
||||||
|
|
||||||
import com.greenorange.promotion.model.entity.PromoRecord;
|
|
||||||
import com.baomidou.mybatisplus.extension.service.IService;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @author 35880
|
|
||||||
* @description 针对表【promo_record(推广记录表)】的数据库操作Service
|
|
||||||
* @createDate 2025-06-23 18:31:45
|
|
||||||
*/
|
|
||||||
public interface PromoRecordService extends IService<PromoRecord> {
|
|
||||||
|
|
||||||
}
|
|
@ -1,44 +0,0 @@
|
|||||||
package com.greenorange.promotion.service.course.impl;
|
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
||||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
||||||
import com.greenorange.promotion.constant.CommonConstant;
|
|
||||||
import com.greenorange.promotion.model.dto.courseChapter.CourseChapterQueryRequest;
|
|
||||||
import com.greenorange.promotion.model.entity.CourseChapter;
|
|
||||||
import com.greenorange.promotion.service.course.CourseChapterService;
|
|
||||||
import com.greenorange.promotion.mapper.CourseChapterMapper;
|
|
||||||
import com.greenorange.promotion.utils.SqlUtils;
|
|
||||||
import org.apache.commons.lang3.StringUtils;
|
|
||||||
import org.springframework.stereotype.Service;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @author 35880
|
|
||||||
* @description 针对表【course_chapter(课程章节表)】的数据库操作Service实现
|
|
||||||
* @createDate 2025-06-23 18:30:28
|
|
||||||
*/
|
|
||||||
@Service
|
|
||||||
public class CourseChapterServiceImpl extends ServiceImpl<CourseChapterMapper, CourseChapter>
|
|
||||||
implements CourseChapterService{
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 获取查询条件
|
|
||||||
*/
|
|
||||||
@Override
|
|
||||||
public QueryWrapper<CourseChapter> getQueryWrapper(CourseChapterQueryRequest courseChapterQueryRequest) {
|
|
||||||
Long courseId = courseChapterQueryRequest.getCourseId();
|
|
||||||
String name = courseChapterQueryRequest.getName();
|
|
||||||
String permissions = courseChapterQueryRequest.getPermissions();
|
|
||||||
String sortField = courseChapterQueryRequest.getSortField();
|
|
||||||
String sortOrder = courseChapterQueryRequest.getSortOrder();
|
|
||||||
QueryWrapper<CourseChapter> queryWrapper = new QueryWrapper<>();
|
|
||||||
queryWrapper.eq("courseId", courseId);
|
|
||||||
queryWrapper.eq(StringUtils.isNotBlank(name), "name", name);
|
|
||||||
queryWrapper.eq(StringUtils.isNotBlank(permissions), "permissions", permissions);
|
|
||||||
queryWrapper.orderBy(SqlUtils.validSortField(sortField), sortOrder.equals(CommonConstant.SORT_ORDER_ASC), sortField);
|
|
||||||
return queryWrapper;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -1,22 +0,0 @@
|
|||||||
package com.greenorange.promotion.service.course.impl;
|
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
||||||
import com.greenorange.promotion.model.entity.CourseQrcodeApply;
|
|
||||||
import com.greenorange.promotion.service.course.CourseQrcodeApplyService;
|
|
||||||
import com.greenorange.promotion.mapper.CourseQrcodeApplyMapper;
|
|
||||||
import org.springframework.stereotype.Service;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @author 35880
|
|
||||||
* @description 针对表【course_qrcode_apply(课程推广码申请表)】的数据库操作Service实现
|
|
||||||
* @createDate 2025-06-24 22:10:39
|
|
||||||
*/
|
|
||||||
@Service
|
|
||||||
public class CourseQrcodeApplyServiceImpl extends ServiceImpl<CourseQrcodeApplyMapper, CourseQrcodeApply>
|
|
||||||
implements CourseQrcodeApplyService{
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -1,22 +0,0 @@
|
|||||||
package com.greenorange.promotion.service.course.impl;
|
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
||||||
import com.greenorange.promotion.model.entity.PromoRecord;
|
|
||||||
import com.greenorange.promotion.service.course.PromoRecordService;
|
|
||||||
import com.greenorange.promotion.mapper.PromoRecordMapper;
|
|
||||||
import org.springframework.stereotype.Service;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @author 35880
|
|
||||||
* @description 针对表【promo_record(推广记录表)】的数据库操作Service实现
|
|
||||||
* @createDate 2025-06-23 18:31:45
|
|
||||||
*/
|
|
||||||
@Service
|
|
||||||
public class PromoRecordServiceImpl extends ServiceImpl<PromoRecordMapper, PromoRecord>
|
|
||||||
implements PromoRecordService{
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -65,7 +65,7 @@ public class ProjectCommissionServiceImpl extends ServiceImpl<ProjectCommissionM
|
|||||||
public void updateProjectCommissionRate(ProjectCommissionUpdateRequest projectCommissionUpdateRequest) {
|
public void updateProjectCommissionRate(ProjectCommissionUpdateRequest projectCommissionUpdateRequest) {
|
||||||
Long id = projectCommissionUpdateRequest.getId();
|
Long id = projectCommissionUpdateRequest.getId();
|
||||||
BigDecimal currentCommissionRate = projectCommissionUpdateRequest.getCurrentCommissionRate();
|
BigDecimal currentCommissionRate = projectCommissionUpdateRequest.getCurrentCommissionRate();
|
||||||
// 获取当前项目明细信息
|
// 获取当前项目明细抽佣信息
|
||||||
ProjectCommission projectCommission = this.getById(id);
|
ProjectCommission projectCommission = this.getById(id);
|
||||||
ThrowUtils.throwIf(projectCommission == null, ErrorCode.OPERATION_ERROR, "项目明细抽佣信息不存在");
|
ThrowUtils.throwIf(projectCommission == null, ErrorCode.OPERATION_ERROR, "项目明细抽佣信息不存在");
|
||||||
Long projectDetailId = projectCommission.getProjectDetailId();
|
Long projectDetailId = projectCommission.getProjectDetailId();
|
||||||
@ -356,7 +356,7 @@ public class ProjectCommissionServiceImpl extends ServiceImpl<ProjectCommissionM
|
|||||||
|
|
||||||
startTime = System.currentTimeMillis();
|
startTime = System.currentTimeMillis();
|
||||||
|
|
||||||
// 更新用户项目明细抽佣记录
|
// 批量更新用户项目明细抽佣记录
|
||||||
List<SubUserProjectCommission> proCommissions = subProjectCommissions.stream().filter(subProjectCommission -> subProjectCommission.getSubUserId() == -1L).toList();
|
List<SubUserProjectCommission> proCommissions = subProjectCommissions.stream().filter(subProjectCommission -> subProjectCommission.getSubUserId() == -1L).toList();
|
||||||
List<ProjectCommission> proCommissionList = commonService.convertList(proCommissions, ProjectCommission.class);
|
List<ProjectCommission> proCommissionList = commonService.convertList(proCommissions, ProjectCommission.class);
|
||||||
// this.updateBatchById(proCommissionList);
|
// this.updateBatchById(proCommissionList);
|
||||||
|
@ -0,0 +1,20 @@
|
|||||||
|
package com.greenorange.promotion.service.userInfo;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||||
|
import com.greenorange.promotion.model.dto.advancementApply.AdvancementApplyQueryRequest;
|
||||||
|
import com.greenorange.promotion.model.entity.AdvancementApply;
|
||||||
|
import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author 35880
|
||||||
|
* @description 针对表【advancement_apply(晋升申请表)】的数据库操作Service
|
||||||
|
* @createDate 2025-06-29 12:39:54
|
||||||
|
*/
|
||||||
|
public interface AdvancementApplyService extends IService<AdvancementApply> {
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取查询条件
|
||||||
|
*/
|
||||||
|
QueryWrapper<AdvancementApply> getQueryWrapper(AdvancementApplyQueryRequest advancementApplyQueryRequest);
|
||||||
|
}
|
@ -1,10 +1,13 @@
|
|||||||
package com.greenorange.promotion.service.userInfo;
|
package com.greenorange.promotion.service.userInfo;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||||
import com.greenorange.promotion.model.dto.userInfo.*;
|
|
||||||
import com.greenorange.promotion.model.entity.UserInfo;
|
|
||||||
import com.baomidou.mybatisplus.extension.service.IService;
|
import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
import jakarta.servlet.http.HttpServletRequest;
|
import com.greenorange.promotion.model.dto.advancementApply.AdvancementApplyApproveRequest;
|
||||||
|
import com.greenorange.promotion.model.dto.userInfo.*;
|
||||||
|
import com.greenorange.promotion.model.entity.AdvancementApply;
|
||||||
|
import com.greenorange.promotion.model.entity.UserInfo;
|
||||||
|
import com.greenorange.promotion.model.enums.UserRoleEnum;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
@ -68,4 +71,28 @@ public interface UserInfoService extends IService<UserInfo> {
|
|||||||
* 查询从 userId 一路到根节点的所有 id,按 depth 倒序(根先出)
|
* 查询从 userId 一路到根节点的所有 id,按 depth 倒序(根先出)
|
||||||
*/
|
*/
|
||||||
List<Long> findPathToRoot(Long userId);
|
List<Long> findPathToRoot(Long userId);
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 校验用户手机号和验证码
|
||||||
|
*/
|
||||||
|
void checkPhoneAndVerificationCode(String phoneNumber, String verificationCode, UserRoleEnum userRoleEnum);
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据用户权限来获取查询条件
|
||||||
|
*/
|
||||||
|
LambdaQueryWrapper<UserInfo> getQueryWrapperByUserRole(UserRoleEnum userRoleEnum, LambdaQueryWrapper<UserInfo> lambdaQueryWrapper);
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 小程序端员工信息注册
|
||||||
|
*/
|
||||||
|
void staffUserInfoMiniRegister(AdvancementApplyApproveRequest advancementApplyApproveRequest);
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取小程序用户的查询条件
|
||||||
|
*/
|
||||||
|
LambdaQueryWrapper<UserInfo> getMiniUserInfoQueryWrapper();
|
||||||
}
|
}
|
||||||
|
@ -0,0 +1,44 @@
|
|||||||
|
package com.greenorange.promotion.service.userInfo.impl;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||||
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
|
import com.greenorange.promotion.constant.CommonConstant;
|
||||||
|
import com.greenorange.promotion.model.dto.advancementApply.AdvancementApplyQueryRequest;
|
||||||
|
import com.greenorange.promotion.model.entity.AdvancementApply;
|
||||||
|
import com.greenorange.promotion.service.userInfo.AdvancementApplyService;
|
||||||
|
import com.greenorange.promotion.mapper.AdvancementApplyMapper;
|
||||||
|
import com.greenorange.promotion.utils.SqlUtils;
|
||||||
|
import org.apache.commons.lang3.StringUtils;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author 35880
|
||||||
|
* @description 针对表【advancement_apply(晋升申请表)】的数据库操作Service实现
|
||||||
|
* @createDate 2025-06-29 12:39:54
|
||||||
|
*/
|
||||||
|
@Service
|
||||||
|
public class AdvancementApplyServiceImpl extends ServiceImpl<AdvancementApplyMapper, AdvancementApply>
|
||||||
|
implements AdvancementApplyService{
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取查询条件
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public QueryWrapper<AdvancementApply> getQueryWrapper(AdvancementApplyQueryRequest advancementApplyQueryRequest) {
|
||||||
|
String name = advancementApplyQueryRequest.getName();
|
||||||
|
String phone = advancementApplyQueryRequest.getPhone();
|
||||||
|
String reviewStatus = advancementApplyQueryRequest.getReviewStatus();
|
||||||
|
String sortField = advancementApplyQueryRequest.getSortField();
|
||||||
|
String sortOrder = advancementApplyQueryRequest.getSortOrder();
|
||||||
|
QueryWrapper<AdvancementApply> queryWrapper = new QueryWrapper<>();
|
||||||
|
queryWrapper.eq(StringUtils.isNotBlank(name), "name", name);
|
||||||
|
queryWrapper.eq(StringUtils.isNotBlank(phone), "phone", phone);
|
||||||
|
queryWrapper.eq(StringUtils.isNotBlank(reviewStatus), "reviewStatus", reviewStatus);
|
||||||
|
queryWrapper.orderBy(SqlUtils.validSortField(sortField), sortOrder.equals(CommonConstant.SORT_ORDER_DESC), sortField);
|
||||||
|
return queryWrapper;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -12,14 +12,17 @@ import com.greenorange.promotion.constant.SystemConstant;
|
|||||||
import com.greenorange.promotion.constant.UserConstant;
|
import com.greenorange.promotion.constant.UserConstant;
|
||||||
import com.greenorange.promotion.exception.ThrowUtils;
|
import com.greenorange.promotion.exception.ThrowUtils;
|
||||||
import com.greenorange.promotion.mapper.UserInfoMapper;
|
import com.greenorange.promotion.mapper.UserInfoMapper;
|
||||||
|
import com.greenorange.promotion.model.dto.advancementApply.AdvancementApplyApproveRequest;
|
||||||
import com.greenorange.promotion.model.dto.projectCommission.ProjectCommissionAddRequest;
|
import com.greenorange.promotion.model.dto.projectCommission.ProjectCommissionAddRequest;
|
||||||
import com.greenorange.promotion.model.dto.userInfo.*;
|
import com.greenorange.promotion.model.dto.userInfo.*;
|
||||||
import com.greenorange.promotion.model.entity.*;
|
import com.greenorange.promotion.model.entity.*;
|
||||||
|
import com.greenorange.promotion.model.enums.ReviewStatusEnum;
|
||||||
import com.greenorange.promotion.model.enums.UserRoleEnum;
|
import com.greenorange.promotion.model.enums.UserRoleEnum;
|
||||||
import com.greenorange.promotion.service.common.CommonService;
|
import com.greenorange.promotion.service.common.CommonService;
|
||||||
import com.greenorange.promotion.service.project.ProjectCommissionService;
|
import com.greenorange.promotion.service.project.ProjectCommissionService;
|
||||||
import com.greenorange.promotion.service.project.ProjectDetailService;
|
import com.greenorange.promotion.service.project.ProjectDetailService;
|
||||||
import com.greenorange.promotion.service.project.SubUserProjectCommissionService;
|
import com.greenorange.promotion.service.project.SubUserProjectCommissionService;
|
||||||
|
import com.greenorange.promotion.service.userInfo.AdvancementApplyService;
|
||||||
import com.greenorange.promotion.service.userInfo.UserInfoService;
|
import com.greenorange.promotion.service.userInfo.UserInfoService;
|
||||||
import com.greenorange.promotion.service.userInfo.UserMainInfoService;
|
import com.greenorange.promotion.service.userInfo.UserMainInfoService;
|
||||||
import com.greenorange.promotion.service.wechat.WechatGetQrcodeService;
|
import com.greenorange.promotion.service.wechat.WechatGetQrcodeService;
|
||||||
@ -28,7 +31,6 @@ import com.greenorange.promotion.utils.RegexUtils;
|
|||||||
import com.greenorange.promotion.utils.SendSmsUtil;
|
import com.greenorange.promotion.utils.SendSmsUtil;
|
||||||
import com.greenorange.promotion.utils.SqlUtils;
|
import com.greenorange.promotion.utils.SqlUtils;
|
||||||
import jakarta.annotation.Resource;
|
import jakarta.annotation.Resource;
|
||||||
import jakarta.servlet.http.HttpServletRequest;
|
|
||||||
import org.apache.commons.lang3.StringUtils;
|
import org.apache.commons.lang3.StringUtils;
|
||||||
import org.springframework.data.redis.core.RedisTemplate;
|
import org.springframework.data.redis.core.RedisTemplate;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
@ -36,13 +38,11 @@ import org.springframework.transaction.annotation.Transactional;
|
|||||||
|
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.math.BigDecimal;
|
import java.math.BigDecimal;
|
||||||
import java.math.RoundingMode;
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import java.util.concurrent.TimeUnit;
|
import java.util.concurrent.TimeUnit;
|
||||||
import java.util.function.Function;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author 35880
|
* @author 35880
|
||||||
@ -89,6 +89,10 @@ public class UserInfoServiceImpl extends ServiceImpl<UserInfoMapper, UserInfo>
|
|||||||
private ProjectDetailService projectDetailService;
|
private ProjectDetailService projectDetailService;
|
||||||
|
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private AdvancementApplyService advancementApplyService;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -131,6 +135,10 @@ public class UserInfoServiceImpl extends ServiceImpl<UserInfoMapper, UserInfo>
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 小程序用户注册
|
* 小程序用户注册
|
||||||
*/
|
*/
|
||||||
@ -138,87 +146,31 @@ public class UserInfoServiceImpl extends ServiceImpl<UserInfoMapper, UserInfo>
|
|||||||
@Transactional(rollbackFor = Exception.class)
|
@Transactional(rollbackFor = Exception.class)
|
||||||
public void userInfoMiniRegister(UserInfoRegisterRequest userInfoRegisterRequest) {
|
public void userInfoMiniRegister(UserInfoRegisterRequest userInfoRegisterRequest) {
|
||||||
String phoneNumber = userInfoRegisterRequest.getPhoneNumber();
|
String phoneNumber = userInfoRegisterRequest.getPhoneNumber();
|
||||||
ThrowUtils.throwIf(RegexUtils.isPhoneInvalid(phoneNumber), ErrorCode.PARAMS_ERROR, "手机号格式无效");
|
|
||||||
LambdaQueryWrapper<UserInfo> phoneNumberLambdaQueryWrapper = new LambdaQueryWrapper<>();
|
|
||||||
phoneNumberLambdaQueryWrapper.eq(UserInfo::getPhoneNumber, phoneNumber);
|
|
||||||
UserInfo userInfo = this.getOne(phoneNumberLambdaQueryWrapper);
|
|
||||||
ThrowUtils.throwIf(userInfo != null, ErrorCode.OPERATION_ERROR, "手机号已注册");
|
|
||||||
|
|
||||||
String verificationCode = userInfoRegisterRequest.getVerificationCode();
|
String verificationCode = userInfoRegisterRequest.getVerificationCode();
|
||||||
String code = redisTemplate.opsForValue().get(SystemConstant.VERIFICATION_CODE + ":" + verificationCode);
|
// 校验用户手机号和验证码
|
||||||
ThrowUtils.throwIf(code == null, ErrorCode.OPERATION_ERROR, "验证码已失效");
|
checkPhoneAndVerificationCode(phoneNumber, verificationCode, UserRoleEnum.USER);
|
||||||
|
|
||||||
// // 移除验证码
|
|
||||||
// redisTemplate.delete(SystemConstant.VERIFICATION_CODE + ":" + verificationCode);
|
|
||||||
|
|
||||||
|
// 根据邀请码获得上级用户信息
|
||||||
String invitationCode = userInfoRegisterRequest.getInvitationCode();
|
String invitationCode = userInfoRegisterRequest.getInvitationCode();
|
||||||
LambdaQueryWrapper<UserInfo> invitedLambdaQueryWrapper = new LambdaQueryWrapper<>();
|
UserInfo parentUserInfo = getParentUserInfoByInvitationCode(invitationCode);
|
||||||
invitedLambdaQueryWrapper.eq(UserInfo::getInvitationCode, invitationCode).eq(UserInfo::getUserRole, UserConstant.DEFAULT_ROLE);
|
|
||||||
UserInfo parentUserInfo = this.getOne(invitedLambdaQueryWrapper);
|
|
||||||
ThrowUtils.throwIf(parentUserInfo == null, ErrorCode.OPERATION_ERROR, "邀请码错误");
|
|
||||||
|
|
||||||
|
// 保存用户
|
||||||
UserInfo myUserInfo = commonService.copyProperties(userInfoRegisterRequest, UserInfo.class);
|
UserInfo myUserInfo = commonService.copyProperties(userInfoRegisterRequest, UserInfo.class);
|
||||||
// 判断当前用户是否是根节点
|
|
||||||
List<UserInfo> userInfoList = commonService.findByFieldEqTargetField(UserInfo::getUserRole, UserConstant.DEFAULT_ROLE, this);
|
|
||||||
if (userInfoList.isEmpty()) myUserInfo.setParentUserId(0L);
|
|
||||||
myUserInfo.setParentUserId(parentUserInfo.getId());
|
myUserInfo.setParentUserId(parentUserInfo.getId());
|
||||||
myUserInfo.setInvitationCode(RandomUtil.randomNumbers(6));
|
myUserInfo.setInvitationCode(RandomUtil.randomNumbers(6));
|
||||||
myUserInfo.setUserAccount(phoneNumber);
|
myUserInfo.setUserAccount(phoneNumber);
|
||||||
myUserInfo.setUserRole(UserConstant.DEFAULT_ROLE);
|
myUserInfo.setUserRole(UserConstant.DEFAULT_ROLE);
|
||||||
myUserInfo.setUserAvatar(UserConstant.USER_DEFAULT_AVATAR);
|
myUserInfo.setUserAvatar(UserConstant.USER_DEFAULT_AVATAR);
|
||||||
this.save(myUserInfo);
|
this.save(myUserInfo);
|
||||||
UserMainInfo userMainInfo = new UserMainInfo();
|
|
||||||
userMainInfo.setUserId(myUserInfo.getId());
|
|
||||||
|
|
||||||
// 批量更新父级用户团队人数
|
// 批量更新父级用户团队人数
|
||||||
List<Long> pathToRoot = this.findPathToRoot(myUserInfo.getId());
|
UserMainInfo userMainInfo = updateParentUserInfoTeamCount(myUserInfo.getId());
|
||||||
List<UserMainInfo> userMainInfoList = commonService.findByFieldInTargetField(pathToRoot, userMainInfoService, id -> id, UserMainInfo::getUserId);
|
|
||||||
for (UserMainInfo mainInfo : userMainInfoList) {
|
|
||||||
mainInfo.setTeamSize(mainInfo.getTeamSize() + 1);
|
|
||||||
}
|
|
||||||
userMainInfoService.updateBatchById(userMainInfoList);
|
|
||||||
|
|
||||||
// 生成邀请二维码
|
// 生成邀请二维码
|
||||||
try {
|
generateInvitationQrcode(userMainInfo, myUserInfo.getInvitationCode());
|
||||||
String view = wechatGetQrcodeService.getWxQrCode(myUserInfo.getInvitationCode());
|
|
||||||
userMainInfo.setInviteQrCode(view);
|
|
||||||
} catch (IOException e) {
|
|
||||||
e.printStackTrace();
|
|
||||||
}
|
|
||||||
userMainInfoService.save(userMainInfo);
|
|
||||||
|
|
||||||
// 查询上级用户的项目抽佣记录
|
// 批量保存当前用户的项目明细抽佣记录和下级用户项目明细抽佣记录
|
||||||
List<ProjectCommission> projectCommissionList = commonService.findByFieldEqTargetField(ProjectCommission::getUserId, parentUserInfo.getId(), projectCommissionService);
|
saveBatchProjectCommissionAndSubUserProjectCommission(myUserInfo.getId(), parentUserInfo.getId());
|
||||||
// 封装Map集合(键:项目明细id, 值:项目最小价格)
|
|
||||||
Map<Long, BigDecimal> projectDetailMinPriceMap = new HashMap<>();
|
|
||||||
List<ProjectDetail> projectDetailList = commonService.findByFieldInTargetField(projectCommissionList, projectDetailService, ProjectCommission::getProjectDetailId, ProjectDetail::getId);
|
|
||||||
for (ProjectDetail projectDetail : projectDetailList) {
|
|
||||||
projectDetailMinPriceMap.put(projectDetail.getId(), projectDetail.getProjectMinSettlementPrice());
|
|
||||||
}
|
|
||||||
// 插入当前用户的项目抽佣记录
|
|
||||||
List<ProjectCommission> projectCommissions = new ArrayList<>();
|
|
||||||
for (ProjectCommission projectCommission : projectCommissionList) {
|
|
||||||
ProjectCommissionAddRequest projectCommissionAddRequest = commonService.copyProperties(projectCommission, ProjectCommissionAddRequest.class);
|
|
||||||
ProjectCommission proCommission = commonService.copyProperties(projectCommissionAddRequest, ProjectCommission.class);
|
|
||||||
// 获取当前项目明细的最小结算价格
|
|
||||||
BigDecimal projectMinSettlementPrice = projectDetailMinPriceMap.get(projectCommission.getProjectDetailId());
|
|
||||||
BigDecimal currentSettlementPrice = projectCommission.getMyUnitPrice().multiply(BigDecimal.ONE.subtract(projectCommission.getCurrentCommissionRate().divide(BigDecimal.valueOf(100))));
|
|
||||||
// 比较当前结算价格和项目明细最小结算价格,取出最大值
|
|
||||||
proCommission.setMyUnitPrice(projectMinSettlementPrice.max(currentSettlementPrice));
|
|
||||||
proCommission.setCurrentCommissionRate(BigDecimal.ZERO);
|
|
||||||
proCommission.setUserId(myUserInfo.getId());
|
|
||||||
projectCommissions.add(proCommission);
|
|
||||||
}
|
|
||||||
projectCommissionService.saveBatch(projectCommissions);
|
|
||||||
// 插入下级用户的项目明细抽佣记录
|
|
||||||
List<SubUserProjectCommission> subUserProjectCommissionList = new ArrayList<>();
|
|
||||||
for (ProjectCommission projectCommission : projectCommissionList) {
|
|
||||||
ProjectCommissionAddRequest projectCommissionAddRequest = commonService.copyProperties(projectCommission, ProjectCommissionAddRequest.class);
|
|
||||||
SubUserProjectCommission subUserProjectCommission = commonService.copyProperties(projectCommissionAddRequest, SubUserProjectCommission.class);
|
|
||||||
subUserProjectCommission.setSubUserId(myUserInfo.getId());
|
|
||||||
subUserProjectCommissionList.add(subUserProjectCommission);
|
|
||||||
}
|
|
||||||
subUserProjectCommissionService.saveBatch(subUserProjectCommissionList);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -254,14 +206,9 @@ public class UserInfoServiceImpl extends ServiceImpl<UserInfoMapper, UserInfo>
|
|||||||
@Override
|
@Override
|
||||||
public String userInfoMiniLoginByVcd(UserInfoMiniVerifyCodeLoginRequest userInfoMiniVerifyCodeLoginRequest) {
|
public String userInfoMiniLoginByVcd(UserInfoMiniVerifyCodeLoginRequest userInfoMiniVerifyCodeLoginRequest) {
|
||||||
String phoneNumber = userInfoMiniVerifyCodeLoginRequest.getPhoneNumber();
|
String phoneNumber = userInfoMiniVerifyCodeLoginRequest.getPhoneNumber();
|
||||||
ThrowUtils.throwIf(RegexUtils.isPhoneInvalid(phoneNumber), ErrorCode.PARAMS_ERROR, "手机号格式无效");
|
|
||||||
|
|
||||||
String verificationCode = userInfoMiniVerifyCodeLoginRequest.getVerificationCode();
|
String verificationCode = userInfoMiniVerifyCodeLoginRequest.getVerificationCode();
|
||||||
String code = redisTemplate.opsForValue().get(SystemConstant.VERIFICATION_CODE + ":" + verificationCode);
|
// 校验用户手机号和验证码
|
||||||
ThrowUtils.throwIf(code == null, ErrorCode.OPERATION_ERROR, "验证码已失效");
|
checkPhoneAndVerificationCode(phoneNumber, verificationCode, null);
|
||||||
|
|
||||||
// // 移除验证码
|
|
||||||
// redisTemplate.delete(SystemConstant.VERIFICATION_CODE + ":" + verificationCode);
|
|
||||||
|
|
||||||
LambdaQueryWrapper<UserInfo> lambdaQueryWrapper = new LambdaQueryWrapper<>();
|
LambdaQueryWrapper<UserInfo> lambdaQueryWrapper = new LambdaQueryWrapper<>();
|
||||||
lambdaQueryWrapper.eq(UserInfo::getPhoneNumber, phoneNumber);
|
lambdaQueryWrapper.eq(UserInfo::getPhoneNumber, phoneNumber);
|
||||||
@ -282,14 +229,9 @@ public class UserInfoServiceImpl extends ServiceImpl<UserInfoMapper, UserInfo>
|
|||||||
@Override
|
@Override
|
||||||
public void userInfoMiniResetPwd(UserInfoResetRequest userInfoResetRequest, boolean isInner) {
|
public void userInfoMiniResetPwd(UserInfoResetRequest userInfoResetRequest, boolean isInner) {
|
||||||
String phoneNumber = userInfoResetRequest.getPhoneNumber();
|
String phoneNumber = userInfoResetRequest.getPhoneNumber();
|
||||||
ThrowUtils.throwIf(RegexUtils.isPhoneInvalid(phoneNumber), ErrorCode.PARAMS_ERROR, "手机号格式无效");
|
|
||||||
|
|
||||||
String verificationCode = userInfoResetRequest.getVerificationCode();
|
String verificationCode = userInfoResetRequest.getVerificationCode();
|
||||||
String code = redisTemplate.opsForValue().get(SystemConstant.VERIFICATION_CODE + ":" + verificationCode);
|
// 校验用户手机号和验证码
|
||||||
ThrowUtils.throwIf(code == null, ErrorCode.OPERATION_ERROR, "验证码已失效");
|
checkPhoneAndVerificationCode(phoneNumber, verificationCode, null);
|
||||||
|
|
||||||
// // 移除验证码
|
|
||||||
// redisTemplate.delete(SystemConstant.VERIFICATION_CODE + ":" + verificationCode);
|
|
||||||
|
|
||||||
String userPassword = userInfoResetRequest.getUserPassword();
|
String userPassword = userInfoResetRequest.getUserPassword();
|
||||||
String userConfirmPassword = userInfoResetRequest.getUserConfirmPassword();
|
String userConfirmPassword = userInfoResetRequest.getUserConfirmPassword();
|
||||||
@ -340,6 +282,7 @@ public class UserInfoServiceImpl extends ServiceImpl<UserInfoMapper, UserInfo>
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 小程序用户获取验证码(用于注册)
|
* 小程序用户获取验证码(用于注册)
|
||||||
*/
|
*/
|
||||||
@ -360,6 +303,184 @@ public class UserInfoServiceImpl extends ServiceImpl<UserInfoMapper, UserInfo>
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 校验用户手机号和验证码
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public void checkPhoneAndVerificationCode(String phoneNumber, String verificationCode, UserRoleEnum userRoleEnum) {
|
||||||
|
ThrowUtils.throwIf(RegexUtils.isPhoneInvalid(phoneNumber), ErrorCode.PARAMS_ERROR, "手机号格式无效");
|
||||||
|
if (userRoleEnum != null) {
|
||||||
|
LambdaQueryWrapper<UserInfo> phoneNumberLambdaQueryWrapper = new LambdaQueryWrapper<>();
|
||||||
|
phoneNumberLambdaQueryWrapper.eq(UserInfo::getPhoneNumber, phoneNumber);
|
||||||
|
phoneNumberLambdaQueryWrapper = getQueryWrapperByUserRole(userRoleEnum, phoneNumberLambdaQueryWrapper);
|
||||||
|
UserInfo userInfo = this.getOne(phoneNumberLambdaQueryWrapper);
|
||||||
|
ThrowUtils.throwIf(userInfo != null, ErrorCode.OPERATION_ERROR, "手机号已注册");
|
||||||
|
}
|
||||||
|
String code = redisTemplate.opsForValue().get(SystemConstant.VERIFICATION_CODE + ":" + verificationCode);
|
||||||
|
ThrowUtils.throwIf(code == null, ErrorCode.OPERATION_ERROR, "验证码已失效");
|
||||||
|
|
||||||
|
// // 移除验证码
|
||||||
|
// redisTemplate.delete(SystemConstant.VERIFICATION_CODE + ":" + verificationCode);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据用户权限来获取查询条件
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public LambdaQueryWrapper<UserInfo> getQueryWrapperByUserRole(UserRoleEnum userRoleEnum, LambdaQueryWrapper<UserInfo> userInfoLambdaQueryWrapper) {
|
||||||
|
if (userRoleEnum.equals(UserRoleEnum.USER)) {
|
||||||
|
userInfoLambdaQueryWrapper.eq(UserInfo::getUserRole, userRoleEnum.getValue());
|
||||||
|
} else {
|
||||||
|
userInfoLambdaQueryWrapper.in(UserInfo::getUserRole, UserRoleEnum.MANAGER, UserRoleEnum.SUPERVISOR, UserRoleEnum.STAFF);
|
||||||
|
}
|
||||||
|
return userInfoLambdaQueryWrapper;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 小程序端员工信息注册
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public void staffUserInfoMiniRegister(AdvancementApplyApproveRequest advancementApplyApproveRequest) {
|
||||||
|
// 获取晋升申请记录信息
|
||||||
|
Long applyId = advancementApplyApproveRequest.getApplyId();
|
||||||
|
AdvancementApply advancementApply = advancementApplyService.getById(applyId);
|
||||||
|
String phoneNumber = advancementApply.getPhone();
|
||||||
|
ThrowUtils.throwIf(RegexUtils.isPhoneInvalid(phoneNumber), ErrorCode.PARAMS_ERROR, "手机号格式无效");
|
||||||
|
|
||||||
|
// 根据邀请码获得上级用户信息
|
||||||
|
String invitationCode = advancementApplyApproveRequest.getInvitationCode();
|
||||||
|
UserInfo parentUserInfo = getParentUserInfoByInvitationCode(invitationCode);
|
||||||
|
|
||||||
|
// 添加用户
|
||||||
|
UserInfo myUserInfo = UserInfo.builder()
|
||||||
|
.id(null)
|
||||||
|
.nickName(advancementApply.getName())
|
||||||
|
.phoneNumber(advancementApply.getPhone())
|
||||||
|
.userAvatar(UserConstant.USER_DEFAULT_AVATAR)
|
||||||
|
.userAccount(RandomUtil.randomNumbers(12))
|
||||||
|
.userPassword(RandomUtil.randomString(12))
|
||||||
|
.invitationCode(RandomUtil.randomNumbers(6))
|
||||||
|
.userRole(advancementApplyApproveRequest.getUserRole())
|
||||||
|
.parentUserId(parentUserInfo.getId())
|
||||||
|
.build();
|
||||||
|
this.save(myUserInfo);
|
||||||
|
|
||||||
|
// 批量更新父级用户团队人数
|
||||||
|
UserMainInfo userMainInfo = updateParentUserInfoTeamCount(myUserInfo.getId());
|
||||||
|
|
||||||
|
// 生成邀请二维码
|
||||||
|
generateInvitationQrcode(userMainInfo, myUserInfo.getInvitationCode());
|
||||||
|
|
||||||
|
// 批量保存当前用户的项目明细抽佣记录和下级用户项目明细抽佣记录
|
||||||
|
saveBatchProjectCommissionAndSubUserProjectCommission(myUserInfo.getId(), parentUserInfo.getId());
|
||||||
|
|
||||||
|
// 修改晋升申请记录的审核状态,并绑定申请成功的用户id
|
||||||
|
LambdaUpdateWrapper<AdvancementApply> advancementApplyLambdaUpdateWrapper = new LambdaUpdateWrapper<>();
|
||||||
|
advancementApplyLambdaUpdateWrapper.eq(AdvancementApply::getId, advancementApply.getId())
|
||||||
|
.set(AdvancementApply::getReviewStatus, ReviewStatusEnum.APPROVED.getValue())
|
||||||
|
.set(AdvancementApply::getUserId, myUserInfo.getId());
|
||||||
|
advancementApplyService.update(advancementApplyLambdaUpdateWrapper);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取小程序用户的查询条件
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public LambdaQueryWrapper<UserInfo> getMiniUserInfoQueryWrapper() {
|
||||||
|
LambdaQueryWrapper<UserInfo> userInfoLambdaQueryWrapper = new LambdaQueryWrapper<>();
|
||||||
|
userInfoLambdaQueryWrapper.in(UserInfo::getUserRole, UserRoleEnum.USER, UserRoleEnum.MANAGER, UserRoleEnum.SUPERVISOR, UserRoleEnum.STAFF);
|
||||||
|
return userInfoLambdaQueryWrapper;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据邀请码获得上级用户信息
|
||||||
|
*/
|
||||||
|
private UserInfo getParentUserInfoByInvitationCode(String invitationCode) {
|
||||||
|
LambdaQueryWrapper<UserInfo> invitedLambdaQueryWrapper = new LambdaQueryWrapper<>();
|
||||||
|
invitedLambdaQueryWrapper.eq(UserInfo::getInvitationCode, invitationCode);
|
||||||
|
UserInfo parentUserInfo = this.getOne(invitedLambdaQueryWrapper);
|
||||||
|
ThrowUtils.throwIf(parentUserInfo == null, ErrorCode.OPERATION_ERROR, "邀请码错误");
|
||||||
|
return parentUserInfo;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量更新父级用户团队人数
|
||||||
|
*/
|
||||||
|
private UserMainInfo updateParentUserInfoTeamCount(Long userId) {
|
||||||
|
UserMainInfo userMainInfo = new UserMainInfo();
|
||||||
|
userMainInfo.setUserId(userId);
|
||||||
|
List<Long> pathToRoot = this.findPathToRoot(userId);
|
||||||
|
List<UserMainInfo> userMainInfoList = commonService.findByFieldInTargetField(pathToRoot, userMainInfoService, id -> id, UserMainInfo::getUserId);
|
||||||
|
for (UserMainInfo mainInfo : userMainInfoList) {
|
||||||
|
mainInfo.setTeamSize(mainInfo.getTeamSize() + 1);
|
||||||
|
}
|
||||||
|
userMainInfoService.updateBatchById(userMainInfoList);
|
||||||
|
return userMainInfo;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 生成邀请二维码
|
||||||
|
*/
|
||||||
|
private void generateInvitationQrcode(UserMainInfo userMainInfo, String invitationCode) {
|
||||||
|
try {
|
||||||
|
String view = wechatGetQrcodeService.getWxQrCode(invitationCode);
|
||||||
|
userMainInfo.setInviteQrCode(view);
|
||||||
|
} catch (IOException e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
userMainInfoService.save(userMainInfo);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量保存当前用户的项目明细抽佣记录和下级用户项目明细抽佣记录
|
||||||
|
*/
|
||||||
|
private void saveBatchProjectCommissionAndSubUserProjectCommission(Long userId, Long parentUserId) {
|
||||||
|
// 查询上级用户的项目抽佣记录
|
||||||
|
List<ProjectCommission> projectCommissionList = commonService.findByFieldEqTargetField(ProjectCommission::getUserId, parentUserId, projectCommissionService);
|
||||||
|
// 封装Map集合(键:项目明细id, 值:项目最小价格)
|
||||||
|
Map<Long, BigDecimal> projectDetailMinPriceMap = new HashMap<>();
|
||||||
|
List<ProjectDetail> projectDetailList = commonService.findByFieldInTargetField(projectCommissionList, projectDetailService, ProjectCommission::getProjectDetailId, ProjectDetail::getId);
|
||||||
|
for (ProjectDetail projectDetail : projectDetailList) {
|
||||||
|
projectDetailMinPriceMap.put(projectDetail.getId(), projectDetail.getProjectMinSettlementPrice());
|
||||||
|
}
|
||||||
|
// 插入当前用户的项目抽佣记录
|
||||||
|
List<ProjectCommission> projectCommissions = new ArrayList<>();
|
||||||
|
for (ProjectCommission projectCommission : projectCommissionList) {
|
||||||
|
ProjectCommissionAddRequest projectCommissionAddRequest = commonService.copyProperties(projectCommission, ProjectCommissionAddRequest.class);
|
||||||
|
ProjectCommission proCommission = commonService.copyProperties(projectCommissionAddRequest, ProjectCommission.class);
|
||||||
|
// 获取当前项目明细的最小结算价格
|
||||||
|
BigDecimal projectMinSettlementPrice = projectDetailMinPriceMap.get(projectCommission.getProjectDetailId());
|
||||||
|
BigDecimal currentSettlementPrice = projectCommission.getMyUnitPrice().multiply(BigDecimal.ONE.subtract(projectCommission.getCurrentCommissionRate().divide(BigDecimal.valueOf(100))));
|
||||||
|
// 比较当前结算价格和项目明细最小结算价格,取出最大值
|
||||||
|
proCommission.setMyUnitPrice(projectMinSettlementPrice.max(currentSettlementPrice));
|
||||||
|
proCommission.setCurrentCommissionRate(BigDecimal.ZERO);
|
||||||
|
proCommission.setUserId(userId);
|
||||||
|
projectCommissions.add(proCommission);
|
||||||
|
}
|
||||||
|
projectCommissionService.saveBatch(projectCommissions);
|
||||||
|
// 插入下级用户的项目明细抽佣记录
|
||||||
|
List<SubUserProjectCommission> subUserProjectCommissionList = new ArrayList<>();
|
||||||
|
for (ProjectCommission projectCommission : projectCommissionList) {
|
||||||
|
ProjectCommissionAddRequest projectCommissionAddRequest = commonService.copyProperties(projectCommission, ProjectCommissionAddRequest.class);
|
||||||
|
SubUserProjectCommission subUserProjectCommission = commonService.copyProperties(projectCommissionAddRequest, SubUserProjectCommission.class);
|
||||||
|
subUserProjectCommission.setSubUserId(userId);
|
||||||
|
subUserProjectCommissionList.add(subUserProjectCommission);
|
||||||
|
}
|
||||||
|
subUserProjectCommissionService.saveBatch(subUserProjectCommissionList);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -26,8 +26,8 @@ public interface WechatGetQrcodeService {
|
|||||||
String getWxQrCode(String inviteCode) throws IOException;
|
String getWxQrCode(String inviteCode) throws IOException;
|
||||||
|
|
||||||
|
|
||||||
/**
|
// /**
|
||||||
* 微信小程序获取课程码
|
// * 微信小程序获取课程码
|
||||||
*/
|
// */
|
||||||
String getWxCourseQrCode(CommonRequest courseQrcodeAddRequest, HttpServletRequest request) throws Exception;
|
// String getWxCourseQrCode(CommonRequest courseQrcodeAddRequest, HttpServletRequest request) throws Exception;
|
||||||
}
|
}
|
||||||
|
@ -17,13 +17,10 @@ import com.greenorange.promotion.exception.BusinessException;
|
|||||||
import com.greenorange.promotion.mapper.UserInfoMapper;
|
import com.greenorange.promotion.mapper.UserInfoMapper;
|
||||||
import com.greenorange.promotion.model.dto.CommonRequest;
|
import com.greenorange.promotion.model.dto.CommonRequest;
|
||||||
import com.greenorange.promotion.model.entity.Course;
|
import com.greenorange.promotion.model.entity.Course;
|
||||||
import com.greenorange.promotion.model.entity.CourseQrcodeApply;
|
|
||||||
import com.greenorange.promotion.model.entity.FileInfo;
|
import com.greenorange.promotion.model.entity.FileInfo;
|
||||||
import com.greenorange.promotion.model.entity.UserInfo;
|
import com.greenorange.promotion.model.entity.UserInfo;
|
||||||
import com.greenorange.promotion.service.course.CourseQrcodeApplyService;
|
|
||||||
import com.greenorange.promotion.service.course.CourseService;
|
import com.greenorange.promotion.service.course.CourseService;
|
||||||
import com.greenorange.promotion.service.file.FileInfoService;
|
import com.greenorange.promotion.service.file.FileInfoService;
|
||||||
import com.greenorange.promotion.service.userInfo.UserInfoService;
|
|
||||||
import com.greenorange.promotion.service.wechat.WechatGetQrcodeService;
|
import com.greenorange.promotion.service.wechat.WechatGetQrcodeService;
|
||||||
import com.greenorange.promotion.utils.QRCodeUtil;
|
import com.greenorange.promotion.utils.QRCodeUtil;
|
||||||
import io.swagger.v3.oas.annotations.media.Schema;
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
@ -74,15 +71,6 @@ public class WechatGetQrcodeServiceImpl implements WechatGetQrcodeService {
|
|||||||
@Resource
|
@Resource
|
||||||
private FileInfoService fileInfoService;
|
private FileInfoService fileInfoService;
|
||||||
|
|
||||||
@Resource
|
|
||||||
private UserInfoMapper userInfoMapper;
|
|
||||||
|
|
||||||
@Resource
|
|
||||||
private CourseService courseService;
|
|
||||||
|
|
||||||
@Resource
|
|
||||||
private CourseQrcodeApplyService courseQrcodeApplyService;
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取接口调用凭据
|
* 获取接口调用凭据
|
||||||
@ -207,146 +195,138 @@ public class WechatGetQrcodeServiceImpl implements WechatGetQrcodeService {
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
//
|
||||||
/**
|
// /**
|
||||||
* 微信小程序获取课程码
|
// * 微信小程序获取课程码
|
||||||
*/
|
// */
|
||||||
@Override
|
// @Override
|
||||||
@Transactional(rollbackFor = Exception.class)
|
// @Transactional(rollbackFor = Exception.class)
|
||||||
public String getWxCourseQrCode(CommonRequest commonRequest, HttpServletRequest request) throws Exception {
|
// public String getWxCourseQrCode(CommonRequest commonRequest, HttpServletRequest request) throws Exception {
|
||||||
String accessToken = (String) redisTemplate.opsForValue().get(ACCESS_TOKEN_KEY);
|
// String accessToken = (String) redisTemplate.opsForValue().get(ACCESS_TOKEN_KEY);
|
||||||
if (accessToken == null) {
|
// if (accessToken == null) {
|
||||||
accessToken = this.getAccessToken().getAccess_token();
|
// accessToken = this.getAccessToken().getAccess_token();
|
||||||
}
|
// }
|
||||||
// 获取用户邀请码
|
// // 获取用户邀请码
|
||||||
Long userId = (Long) request.getAttribute("userId");
|
// Long userId = (Long) request.getAttribute("userId");
|
||||||
UserInfo userInfo = userInfoMapper.selectById(userId);
|
// UserInfo userInfo = userInfoMapper.selectById(userId);
|
||||||
String invitationCode = userInfo.getInvitationCode();
|
// String invitationCode = userInfo.getInvitationCode();
|
||||||
// 获取课程信息
|
// // 获取课程信息
|
||||||
Long courseId = commonRequest.getId();
|
// Long courseId = commonRequest.getId();
|
||||||
Course course = courseService.getById(courseId);
|
// Course course = courseService.getById(courseId);
|
||||||
String courseTitle = course.getName();
|
// String courseTitle = course.getName();
|
||||||
String originalPrice = String.valueOf(course.getOriginPrice());
|
// String originalPrice = String.valueOf(course.getOriginPrice());
|
||||||
String discountPrice = String.valueOf(course.getDiscountPrice());
|
// String discountPrice = String.valueOf(course.getDiscountPrice());
|
||||||
String discountText = "元券后价";
|
// String discountText = "元券后价";
|
||||||
|
//
|
||||||
|
//
|
||||||
Map<String, Object> param = new HashMap<>();
|
// Map<String, Object> param = new HashMap<>();
|
||||||
param.put("page", "pages/loginModule/register/register");
|
// param.put("page", "pages/loginModule/register/register");
|
||||||
param.put("scene", "invitationCode=" + invitationCode + "&courseId=" + courseId);
|
// param.put("scene", "invitationCode=" + invitationCode + "&courseId=" + courseId);
|
||||||
param.put("width", 430);
|
// param.put("width", 430);
|
||||||
param.put("check_path", false);
|
// param.put("check_path", false);
|
||||||
param.put("env_version", "develop");
|
// param.put("env_version", "develop");
|
||||||
String url = "https://api.weixin.qq.com/wxa/getwxacodeunlimit?access_token=" + accessToken;
|
// String url = "https://api.weixin.qq.com/wxa/getwxacodeunlimit?access_token=" + accessToken;
|
||||||
String jsonParams = JSONUtil.toJsonStr(param);
|
// String jsonParams = JSONUtil.toJsonStr(param);
|
||||||
byte[] responseBytes = HttpUtil.createPost(url)
|
// byte[] responseBytes = HttpUtil.createPost(url)
|
||||||
.header("Content-Type", "application/json")
|
// .header("Content-Type", "application/json")
|
||||||
.body(jsonParams)
|
// .body(jsonParams)
|
||||||
.execute()
|
// .execute()
|
||||||
.bodyBytes();
|
// .bodyBytes();
|
||||||
|
//
|
||||||
String FontType = "Microsoft YaHei UI";
|
// String FontType = "Microsoft YaHei UI";
|
||||||
int FontStyle = Font.PLAIN;
|
// int FontStyle = Font.PLAIN;
|
||||||
|
//
|
||||||
// 加载一张空白图像
|
// // 加载一张空白图像
|
||||||
String blankUrl = "https://img.picui.cn/free/2025/06/21/6856a072e9eea.png";
|
// String blankUrl = "https://img.picui.cn/free/2025/06/21/6856a072e9eea.png";
|
||||||
ImageCombiner combiner = new ImageCombiner(blankUrl, 341, 391, ZoomMode.WidthHeight, OutputFormat.PNG);
|
// ImageCombiner combiner = new ImageCombiner(blankUrl, 341, 391, ZoomMode.WidthHeight, OutputFormat.PNG);
|
||||||
|
//
|
||||||
// 加载课程图片
|
// // 加载课程图片
|
||||||
String courseUrl = SystemConstant.FILE_COMMON_PREFIX + course.getImage();
|
// String courseUrl = SystemConstant.FILE_COMMON_PREFIX + course.getImage();
|
||||||
BufferedImage courseImage = ImageIO.read(new URL(courseUrl));
|
// BufferedImage courseImage = ImageIO.read(new URL(courseUrl));
|
||||||
|
//
|
||||||
// Graphics2D graphics = courseImage.createGraphics();
|
// // 将二维码数据转换为 BufferedImage
|
||||||
// graphics.setColor(Color.decode("#323232"));
|
// BufferedImage qrImage = ImageIO.read(new ByteArrayInputStream(responseBytes));
|
||||||
// graphics.setFont(new Font("阿里巴巴普惠体", Font.PLAIN, 60));
|
//
|
||||||
// graphics.drawString("测试", 0, 80);
|
// // 缩放图片(不失真)
|
||||||
// graphics.setRenderingHint(RenderingHints.KEY_TEXT_ANTIALIASING,RenderingHints.VALUE_TEXT_ANTIALIAS_LCD_HRGB);
|
// Image scaledImage = qrImage.getScaledInstance(134, 134, Image.SCALE_SMOOTH);
|
||||||
// graphics.drawString("测试", 0, 160);
|
// BufferedImage resizedImage = new BufferedImage(134, 134, BufferedImage.TYPE_INT_RGB);
|
||||||
// graphics.dispose();
|
// resizedImage.getGraphics().drawImage(scaledImage, 0, 0, null);
|
||||||
|
//
|
||||||
// 将二维码数据转换为 BufferedImage
|
// combiner.setQuality(1f);
|
||||||
BufferedImage qrImage = ImageIO.read(new ByteArrayInputStream(responseBytes));
|
//
|
||||||
|
// // 将课程图片合并到组合器中
|
||||||
// 缩放图片(不失真)
|
// combiner.addImageElement(courseImage, 18, 16, 306, 158, ZoomMode.WidthHeight).setRoundCorner(5).setCenter(true);
|
||||||
Image scaledImage = qrImage.getScaledInstance(134, 134, Image.SCALE_SMOOTH);
|
// // 将二维码图片合并到组合器中
|
||||||
BufferedImage resizedImage = new BufferedImage(134, 134, BufferedImage.TYPE_INT_RGB);
|
// combiner.addImageElement(resizedImage, 190, 240);
|
||||||
resizedImage.getGraphics().drawImage(scaledImage, 0, 0, null);
|
//
|
||||||
|
// // 绘制文本
|
||||||
combiner.setQuality(1f);
|
// TextElement courseTitleElement = new TextElement(courseTitle, FontType, FontStyle, 18, 20, 186);
|
||||||
|
// courseTitleElement.setColor(Color.decode("#323232"))
|
||||||
// 将课程图片合并到组合器中
|
// .setCenter(true)
|
||||||
combiner.addImageElement(courseImage, 18, 16, 306, 158, ZoomMode.WidthHeight).setRoundCorner(5).setCenter(true);
|
// .setAutoBreakLine(306);
|
||||||
// 将二维码图片合并到组合器中
|
// combiner.addElement(courseTitleElement);
|
||||||
combiner.addImageElement(resizedImage, 190, 240);
|
//
|
||||||
|
// TextElement originalPriceElement = new TextElement(originalPrice, FontType, FontStyle, 24, 56, 275);
|
||||||
// 绘制文本
|
// originalPriceElement.setColor(Color.decode("#8C8C8C")).setStrikeThrough(true);
|
||||||
TextElement courseTitleElement = new TextElement(courseTitle, FontType, FontStyle, 18, 20, 186);
|
// combiner.addElement(originalPriceElement);
|
||||||
courseTitleElement.setColor(Color.decode("#323232"))
|
//
|
||||||
.setCenter(true)
|
// TextElement discountedPriceElement = new TextElement(discountPrice, FontType, Font.BOLD, 28, 31, 343);
|
||||||
.setAutoBreakLine(306);
|
// discountedPriceElement.setColor(Color.decode("#F84947")).setBaseLine(BaseLine.Base).setSpace(0.01f);
|
||||||
combiner.addElement(courseTitleElement);
|
// combiner.addElement(discountedPriceElement);
|
||||||
|
//
|
||||||
TextElement originalPriceElement = new TextElement(originalPrice, FontType, FontStyle, 24, 56, 275);
|
// TextElement discountedTextElement = new TextElement(discountText, FontType, FontStyle, 16, discountedPriceElement.getX() + discountedPriceElement.getWidth(), 341);
|
||||||
originalPriceElement.setColor(Color.decode("#8C8C8C")).setStrikeThrough(true);
|
// discountedTextElement.setColor(Color.decode("#F84947")).setBaseLine(BaseLine.Base);
|
||||||
combiner.addElement(originalPriceElement);
|
// combiner.addElement(discountedTextElement);
|
||||||
|
//
|
||||||
TextElement discountedPriceElement = new TextElement(discountPrice, FontType, Font.BOLD, 28, 31, 343);
|
// combiner.combine();
|
||||||
discountedPriceElement.setColor(Color.decode("#F84947")).setBaseLine(BaseLine.Base).setSpace(0.01f);
|
//
|
||||||
combiner.addElement(discountedPriceElement);
|
// InputStream resultStream = combiner.getCombinedImageStream();
|
||||||
|
// byte[] resultBytes = resultStream.readAllBytes();
|
||||||
TextElement discountedTextElement = new TextElement(discountText, FontType, FontStyle, 16, discountedPriceElement.getX() + discountedPriceElement.getWidth(), 341);
|
// // 创建上传目录,如果不存在
|
||||||
discountedTextElement.setColor(Color.decode("#F84947")).setBaseLine(BaseLine.Base);
|
// String biz = "default";
|
||||||
combiner.addElement(discountedTextElement);
|
// String fileName = RandomStringUtils.random(8, "ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789") + "." + "png";
|
||||||
|
// // 获取文件类型
|
||||||
combiner.combine();
|
// String fileType = FileUtil.getSuffix(fileName);
|
||||||
|
// // 获取view值
|
||||||
InputStream resultStream = combiner.getCombinedImageStream();
|
// String view = RandomStringUtils.random(8, "ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789");
|
||||||
byte[] resultBytes = resultStream.readAllBytes();
|
// File file = new File(uploadDir + fileName);
|
||||||
// 创建上传目录,如果不存在
|
// if (!file.getParentFile().exists()) {
|
||||||
String biz = "default";
|
// file.getParentFile().mkdirs();// 如果路径不存在则创建
|
||||||
String fileName = RandomStringUtils.random(8, "ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789") + "." + "png";
|
// }
|
||||||
// 获取文件类型
|
// // 将文件上传到目标位置
|
||||||
String fileType = FileUtil.getSuffix(fileName);
|
// try (BufferedOutputStream bos = new BufferedOutputStream(new FileOutputStream(file), BUFFER_SIZE)) {
|
||||||
// 获取view值
|
// bos.write(resultBytes);
|
||||||
String view = RandomStringUtils.random(8, "ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789");
|
// } catch (IOException e) {
|
||||||
File file = new File(uploadDir + fileName);
|
// throw new BusinessException(ErrorCode.OPERATION_ERROR, "文件上传失败,失败原因:" + e.getMessage());
|
||||||
if (!file.getParentFile().exists()) {
|
// }
|
||||||
file.getParentFile().mkdirs();// 如果路径不存在则创建
|
//
|
||||||
}
|
// // 获取文件大小
|
||||||
// 将文件上传到目标位置
|
// Double fileSize = file.length() / 1024.0;
|
||||||
try (BufferedOutputStream bos = new BufferedOutputStream(new FileOutputStream(file), BUFFER_SIZE)) {
|
// fileSize = Double.valueOf(String.format("%.2f", fileSize));
|
||||||
bos.write(resultBytes);
|
// // 获取文件哈希值
|
||||||
} catch (IOException e) {
|
// InputStream inputStream = new FileInputStream(file);
|
||||||
throw new BusinessException(ErrorCode.OPERATION_ERROR, "文件上传失败,失败原因:" + e.getMessage());
|
// String hashValue = DigestUtils.sha256Hex(inputStream);
|
||||||
}
|
// // 保存文件
|
||||||
|
// FileInfo fileInfo = FileInfo.builder()
|
||||||
// 获取文件大小
|
// .name(fileName)
|
||||||
Double fileSize = file.length() / 1024.0;
|
// .type(fileType)
|
||||||
fileSize = Double.valueOf(String.format("%.2f", fileSize));
|
// .size(fileSize)
|
||||||
// 获取文件哈希值
|
// .fileView(view)
|
||||||
InputStream inputStream = new FileInputStream(file);
|
// .biz(biz)
|
||||||
String hashValue = DigestUtils.sha256Hex(inputStream);
|
// .hashValue(hashValue)
|
||||||
// 保存文件
|
// .build();
|
||||||
FileInfo fileInfo = FileInfo.builder()
|
// fileInfoService.save(fileInfo);
|
||||||
.name(fileName)
|
//
|
||||||
.type(fileType)
|
// String viewValue = biz + "-" + view;
|
||||||
.size(fileSize)
|
// // 保存课程推广码申请记录
|
||||||
.fileView(view)
|
// CourseQrcodeApply courseQrcodeApply = CourseQrcodeApply.builder()
|
||||||
.biz(biz)
|
// .userId(userId)
|
||||||
.hashValue(hashValue)
|
// .courseId(courseId)
|
||||||
.build();
|
// .courseQrcode(viewValue)
|
||||||
fileInfoService.save(fileInfo);
|
// .build();
|
||||||
|
// courseQrcodeApplyService.save(courseQrcodeApply);
|
||||||
String viewValue = biz + "-" + view;
|
// return viewValue;
|
||||||
// 保存课程推广码申请记录
|
// }
|
||||||
CourseQrcodeApply courseQrcodeApply = CourseQrcodeApply.builder()
|
|
||||||
.userId(userId)
|
|
||||||
.courseId(courseId)
|
|
||||||
.courseQrcode(viewValue)
|
|
||||||
.build();
|
|
||||||
courseQrcodeApplyService.save(courseQrcodeApply);
|
|
||||||
return viewValue;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -1,15 +1,21 @@
|
|||||||
spring:
|
spring:
|
||||||
datasource:
|
datasource:
|
||||||
|
# driver-class-name: com.mysql.cj.jdbc.Driver
|
||||||
|
# url: jdbc:mysql://27.30.77.229:3306/qingcheng_caozhe?serverTimezone=Asia/Shanghai
|
||||||
|
# username: qingcheng
|
||||||
|
# password: Qc@8ls2jf
|
||||||
|
# hikari:
|
||||||
|
# maximum-pool-size: 300
|
||||||
|
# max-lifetime: 120000
|
||||||
driver-class-name: com.mysql.cj.jdbc.Driver
|
driver-class-name: com.mysql.cj.jdbc.Driver
|
||||||
url: jdbc:mysql://27.30.77.229:3306/qingcheng_caozhe?serverTimezone=Asia/Shanghai
|
url: jdbc:mysql://43.143.28.121:3306/easybbs?serverTimezone=Asia/Shanghai
|
||||||
username: qingcheng
|
username: easybbs
|
||||||
password: Qc@8ls2jf
|
password: root
|
||||||
hikari:
|
hikari:
|
||||||
maximum-pool-size: 300
|
maximum-pool-size: 300
|
||||||
max-lifetime: 120000
|
max-lifetime: 120000
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
data:
|
data:
|
||||||
redis:
|
redis:
|
||||||
port: 6379
|
port: 6379
|
||||||
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -2,23 +2,22 @@
|
|||||||
<!DOCTYPE mapper
|
<!DOCTYPE mapper
|
||||||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||||
<mapper namespace="com.greenorange.promotion.mapper.CourseChapterMapper">
|
<mapper namespace="com.greenorange.promotion.mapper.AdvancementApplyMapper">
|
||||||
|
|
||||||
<resultMap id="BaseResultMap" type="com.greenorange.promotion.model.entity.CourseChapter">
|
<resultMap id="BaseResultMap" type="com.greenorange.promotion.model.entity.AdvancementApply">
|
||||||
<id property="id" column="id" jdbcType="BIGINT"/>
|
<id property="id" column="id" jdbcType="BIGINT"/>
|
||||||
<result property="name" column="name" jdbcType="VARCHAR"/>
|
<result property="name" column="name" jdbcType="VARCHAR"/>
|
||||||
<result property="duration" column="duration" jdbcType="VARCHAR"/>
|
<result property="phone" column="phone" jdbcType="VARCHAR"/>
|
||||||
<result property="permissions" column="permissions" jdbcType="OTHER"/>
|
<result property="resume" column="resume" jdbcType="VARCHAR"/>
|
||||||
<result property="videoView" column="videoView" jdbcType="VARCHAR"/>
|
<result property="reviewStatus" column="reviewStatus" jdbcType="OTHER"/>
|
||||||
<result property="courseId" column="courseId" jdbcType="BIGINT"/>
|
|
||||||
<result property="isDelete" column="isDelete" jdbcType="TINYINT"/>
|
<result property="isDelete" column="isDelete" jdbcType="TINYINT"/>
|
||||||
<result property="createTime" column="createTime" jdbcType="TIMESTAMP"/>
|
<result property="createTime" column="createTime" jdbcType="TIMESTAMP"/>
|
||||||
<result property="updateTime" column="updateTime" jdbcType="TIMESTAMP"/>
|
<result property="updateTime" column="updateTime" jdbcType="TIMESTAMP"/>
|
||||||
</resultMap>
|
</resultMap>
|
||||||
|
|
||||||
<sql id="Base_Column_List">
|
<sql id="Base_Column_List">
|
||||||
id,name,duration,
|
id,name,phone,
|
||||||
permissions,videoView,courseId,
|
resume,reviewStatus,isDelete,
|
||||||
isDelete,createTime,updateTime
|
createTime,updateTime
|
||||||
</sql>
|
</sql>
|
||||||
</mapper>
|
</mapper>
|
@ -1,20 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<!DOCTYPE mapper
|
|
||||||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
||||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
|
||||||
<mapper namespace="com.greenorange.promotion.mapper.CourseQrcodeApplyMapper">
|
|
||||||
|
|
||||||
<resultMap id="BaseResultMap" type="com.greenorange.promotion.model.entity.CourseQrcodeApply">
|
|
||||||
<id property="id" column="id" jdbcType="BIGINT"/>
|
|
||||||
<result property="userId" column="userId" jdbcType="BIGINT"/>
|
|
||||||
<result property="courseId" column="courseId" jdbcType="BIGINT"/>
|
|
||||||
<result property="isDelete" column="isDelete" jdbcType="TINYINT"/>
|
|
||||||
<result property="createTime" column="createTime" jdbcType="TIMESTAMP"/>
|
|
||||||
<result property="updateTime" column="updateTime" jdbcType="TIMESTAMP"/>
|
|
||||||
</resultMap>
|
|
||||||
|
|
||||||
<sql id="Base_Column_List">
|
|
||||||
id,userId,courseId,
|
|
||||||
isDelete,createTime,updateTime
|
|
||||||
</sql>
|
|
||||||
</mapper>
|
|
@ -1,28 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<!DOCTYPE mapper
|
|
||||||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
||||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
|
||||||
<mapper namespace="com.greenorange.promotion.mapper.PromoRecordMapper">
|
|
||||||
|
|
||||||
<resultMap id="BaseResultMap" type="com.greenorange.promotion.model.entity.PromoRecord">
|
|
||||||
<id property="id" column="id" jdbcType="BIGINT"/>
|
|
||||||
<result property="courseId" column="courseId" jdbcType="BIGINT"/>
|
|
||||||
<result property="subUserId" column="subUserId" jdbcType="BIGINT"/>
|
|
||||||
<result property="nickName" column="nickName" jdbcType="VARCHAR"/>
|
|
||||||
<result property="phone" column="phone" jdbcType="VARCHAR"/>
|
|
||||||
<result property="benefits" column="benefits" jdbcType="DECIMAL"/>
|
|
||||||
<result property="bindTime" column="bindTime" jdbcType="VARCHAR"/>
|
|
||||||
<result property="promoType" column="promoType" jdbcType="OTHER"/>
|
|
||||||
<result property="userId" column="userId" jdbcType="BIGINT"/>
|
|
||||||
<result property="isDelete" column="isDelete" jdbcType="TINYINT"/>
|
|
||||||
<result property="createTime" column="createTime" jdbcType="TIMESTAMP"/>
|
|
||||||
<result property="updateTime" column="updateTime" jdbcType="TIMESTAMP"/>
|
|
||||||
</resultMap>
|
|
||||||
|
|
||||||
<sql id="Base_Column_List">
|
|
||||||
id,courseId,subUserId,
|
|
||||||
nickName,phone,benefits,
|
|
||||||
bindTime,promoType,userId,
|
|
||||||
isDelete,createTime,updateTime
|
|
||||||
</sql>
|
|
||||||
</mapper>
|
|
Reference in New Issue
Block a user