新变更
This commit is contained in:
@ -16,6 +16,12 @@ public interface SystemConstant {
|
||||
String FILE_COMMON_PREFIX = "http://160.202.242.36:9091/file/download/";
|
||||
|
||||
|
||||
/**
|
||||
* 默认头像view值
|
||||
*/
|
||||
String DEFAULT_AVATAR_VIEW = "default-QU7P9SD5";
|
||||
|
||||
|
||||
/**
|
||||
* 一级抽成比例
|
||||
*/
|
||||
|
@ -14,7 +14,7 @@ public interface UserConstant {
|
||||
/**
|
||||
* 用户默认头像
|
||||
*/
|
||||
String USER_DEFAULT_AVATAR = "";
|
||||
String USER_DEFAULT_AVATAR = SystemConstant.FILE_COMMON_PREFIX + SystemConstant.DEFAULT_AVATAR_VIEW;
|
||||
|
||||
|
||||
/**
|
||||
|
@ -55,13 +55,13 @@ public class AdvancementApplyController {
|
||||
private UserInfoService userInfoService;
|
||||
|
||||
/**
|
||||
* 小程序段用户添加晋升申请记录
|
||||
* 小程序端用户申请晋升
|
||||
* @param advancementApplyAddRequest 晋升申请记录添加请求体
|
||||
* @return 申请记录查询凭据
|
||||
*/
|
||||
@PostMapping("add")
|
||||
@Operation(summary = "小程序段用户添加晋升申请记录", description = "参数:晋升申请添加请求体,权限:管理员,方法名:addAdvancementApply")
|
||||
@SysLog(title = "晋升申请管理", content = "小程序段用户添加晋升申请记录")
|
||||
@Operation(summary = "小程序端用户申请晋升", description = "参数:晋升申请添加请求体,权限:管理员,方法名:addAdvancementApply")
|
||||
@SysLog(title = "晋升申请管理", content = "小程序端用户申请晋升")
|
||||
public BaseResponse<String> addAdvancementApply(@Valid @RequestBody AdvancementApplyAddRequest advancementApplyAddRequest) {
|
||||
String phone = advancementApplyAddRequest.getPhone();
|
||||
String verificationCode = advancementApplyAddRequest.getVerificationCode();
|
||||
@ -90,24 +90,24 @@ public class AdvancementApplyController {
|
||||
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);
|
||||
}
|
||||
//
|
||||
// /**
|
||||
// * 小程序端用户根据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);
|
||||
// }
|
||||
|
||||
|
||||
/**
|
||||
@ -130,8 +130,8 @@ public class AdvancementApplyController {
|
||||
if (ReviewStatusEnum.APPROVED.equals(reviewStatusEnum)) {
|
||||
Long userId = advancementApply.getUserId();
|
||||
UserInfo userInfo = userInfoService.getById(userId);
|
||||
advancementApplyApproveVO.setUserAccount(userInfo.getUserAccount());
|
||||
advancementApplyApproveVO.setUserPassword(userInfo.getUserPassword());
|
||||
advancementApplyApproveVO.setUserRole(userInfo.getUserRole());
|
||||
}
|
||||
// 如果审核拒绝,填充拒绝理由
|
||||
if (ReviewStatusEnum.REJECTED.equals(reviewStatusEnum)) {
|
||||
|
@ -18,10 +18,7 @@ import com.greenorange.promotion.model.dto.userInfo.*;
|
||||
import com.greenorange.promotion.model.entity.UserInfo;
|
||||
import com.greenorange.promotion.model.entity.UserMainInfo;
|
||||
import com.greenorange.promotion.model.enums.UserRoleEnum;
|
||||
import com.greenorange.promotion.model.vo.userInfo.StaffUserVO;
|
||||
import com.greenorange.promotion.model.vo.userInfo.SuperUserInfoVO;
|
||||
import com.greenorange.promotion.model.vo.userInfo.SupervisorUserVO;
|
||||
import com.greenorange.promotion.model.vo.userInfo.UserInfoVO;
|
||||
import com.greenorange.promotion.model.vo.userInfo.*;
|
||||
import com.greenorange.promotion.model.vo.userMainInfo.UserMainInfoVO;
|
||||
import com.greenorange.promotion.service.common.CommonService;
|
||||
import com.greenorange.promotion.service.userInfo.UserInfoService;
|
||||
@ -73,6 +70,8 @@ public class UserInfoController {
|
||||
private JWTUtils jwtUtils;
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 小程序端用户获取验证码(用于注册)
|
||||
* @param commonStringRequest 手机号
|
||||
@ -110,7 +109,6 @@ public class UserInfoController {
|
||||
*/
|
||||
@PostMapping("inviteCode")
|
||||
@Operation(summary = "小程序端用户根据id获取上级邀请码", description = "参数:用户id,权限:管理员(boss, admin),方法名:getParentUserInviteCode")
|
||||
// @SysLog(title = "用户管理", content = "小程序端用户根据id获取上级邀请码")
|
||||
public BaseResponse<String> getParentUserInviteCode(@Valid @RequestBody CommonRequest commonRequest) {
|
||||
Long id = commonRequest.getId();
|
||||
UserInfo userInfo = userInfoService.getById(id);
|
||||
@ -126,7 +124,6 @@ public class UserInfoController {
|
||||
*/
|
||||
@PostMapping("register")
|
||||
@Operation(summary = "小程序端用户注册", description = "参数:小程序用户注册请求体,权限:管理员(boss, admin),方法名:userInfoMiniRegister")
|
||||
// @SysLog(title = "用户管理", content = "小程序端用户注册")
|
||||
public BaseResponse<Boolean> userInfoMiniRegister(@Valid @RequestBody UserInfoRegisterRequest userInfoRegisterRequest) {
|
||||
userInfoService.userInfoMiniRegister(userInfoRegisterRequest);
|
||||
return ResultUtils.success(true);
|
||||
@ -141,13 +138,13 @@ public class UserInfoController {
|
||||
*/
|
||||
@PostMapping("mini/pwd/login")
|
||||
@Operation(summary = "小程序端用户密码登录", description = "参数:小程序用户密码登录请求体,权限:管理员(boss, admin),方法名:userInfoMiniLogin")
|
||||
// @SysLog(title = "用户管理", content = "小程序端用户密码登录")
|
||||
public BaseResponse<String> userInfoMiniLoginByPwd(@Valid @RequestBody UserInfoMiniPasswordLoginRequest userInfoMiniPasswordLoginRequest) {
|
||||
String token = userInfoService.userInfoMiniLoginByPwd(userInfoMiniPasswordLoginRequest);
|
||||
return ResultUtils.success(token);
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 小程序端用户验证码登录
|
||||
* @param userInfoMiniVerifyCodeLoginRequest 小程序用户验证码登录请求体
|
||||
@ -169,7 +166,6 @@ public class UserInfoController {
|
||||
*/
|
||||
@PostMapping("mini/out/reset/pwd")
|
||||
@Operation(summary = "小程序用户重置密码(外部)", description = "参数:小程序用户密码重置请求体,权限:管理员(boss, admin),方法名:userInfoMiniOuterResetPwd")
|
||||
// @SysLog(title = "用户管理", content = "小程序用户重置密码(外部)")
|
||||
public BaseResponse<Boolean> userInfoMiniOuterResetPwd(@Valid @RequestBody UserInfoResetRequest userInfoResetRequest) {
|
||||
userInfoService.userInfoMiniResetPwd(userInfoResetRequest, false);
|
||||
return ResultUtils.success(true);
|
||||
@ -191,6 +187,9 @@ public class UserInfoController {
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* web端用户根据jwt获取用户信息
|
||||
* @return 用户信息
|
||||
@ -493,7 +492,32 @@ public class UserInfoController {
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* web端管理员查看经理信息
|
||||
* @return 经理信息
|
||||
*/
|
||||
@PostMapping("query/manager")
|
||||
@Operation(summary = "web端管理员查看经理信息", description = "参数:无,权限:管理员(boss, admin),方法名:queryManagerInfo")
|
||||
@RequiresPermission(mustRole = UserConstant.BOSS_ROLE)
|
||||
public BaseResponse<ManagerUserInfoVO> queryManagerInfo() {
|
||||
LambdaQueryWrapper<UserInfo> userInfoLambdaQueryWrapper = commonService.buildQueryWrapperByField(UserInfo::getUserRole, UserConstant.MANAGER_ROLE, userInfoService);
|
||||
UserInfo managerUserInfo = userInfoService.getOne(userInfoLambdaQueryWrapper);
|
||||
ManagerUserInfoVO managerUserInfoVO = commonService.copyProperties(managerUserInfo, ManagerUserInfoVO.class);
|
||||
return ResultUtils.success(managerUserInfoVO);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* web端管理员修改经理信息
|
||||
* @return 是否修改成功
|
||||
*/
|
||||
@PostMapping("modify/manager")
|
||||
@Operation(summary = "web端管理员修改经理信息", description = "参数:无,权限:管理员(boss, admin),方法名:modifyManagerInfo")
|
||||
@RequiresPermission(mustRole = UserConstant.BOSS_ROLE)
|
||||
public BaseResponse<Boolean> modifyManagerInfo(@Valid @RequestBody ManagerUserInfoUpdateRequest managerUserInfoUpdateRequest) {
|
||||
UserInfo userInfo = commonService.copyProperties(managerUserInfoUpdateRequest, UserInfo.class);
|
||||
userInfoService.updateById(userInfo);
|
||||
return ResultUtils.success(true);
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -0,0 +1,145 @@
|
||||
package com.greenorange.promotion.controller.userInfo;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.greenorange.promotion.annotation.RequiresPermission;
|
||||
import com.greenorange.promotion.annotation.SysLog;
|
||||
import com.greenorange.promotion.common.BaseResponse;
|
||||
import com.greenorange.promotion.common.ResultUtils;
|
||||
import com.greenorange.promotion.constant.UserConstant;
|
||||
import com.greenorange.promotion.model.dto.CommonBatchRequest;
|
||||
import com.greenorange.promotion.model.dto.userPerformanceSummary.UserPerformanceSummaryAddRequest;
|
||||
import com.greenorange.promotion.model.dto.userPerformanceSummary.UserPerformanceSummaryQueryRequest;
|
||||
import com.greenorange.promotion.model.dto.userPerformanceSummary.UserPerformanceSummaryUpdateRequest;
|
||||
import com.greenorange.promotion.model.entity.UserPerformanceSummary;
|
||||
import com.greenorange.promotion.model.vo.userPerformanceSummary.UserPerformanceSummaryVO;
|
||||
import com.greenorange.promotion.service.common.CommonService;
|
||||
import com.greenorange.promotion.service.userInfo.UserPerformanceSummaryService;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import jakarta.annotation.Resource;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.greenorange.promotion.model.dto.CommonRequest;
|
||||
import jakarta.validation.Valid;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
|
||||
/**
|
||||
* 用户绩效汇总 控制器
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("perform")
|
||||
@Slf4j
|
||||
@Tag(name = "用户绩效汇总模块")
|
||||
public class UserPerformanceSummaryController {
|
||||
|
||||
@Resource
|
||||
private UserPerformanceSummaryService userPerformanceSummaryService;
|
||||
|
||||
@Resource
|
||||
private CommonService commonService;
|
||||
|
||||
/**
|
||||
* web端管理员添加用户绩效汇总
|
||||
* @param userPerformanceSummaryAddRequest 用户绩效汇总添加请求体
|
||||
* @return 是否添加成功
|
||||
*/
|
||||
@PostMapping("add")
|
||||
@Operation(summary = "web端管理员添加用户绩效汇总", description = "参数:用户绩效汇总添加请求体,权限:管理员,方法名:addUserPerformanceSummary")
|
||||
@RequiresPermission(mustRole = UserConstant.ADMIN_ROLE)
|
||||
@SysLog(title = "用户绩效汇总管理", content = "web端管理员添加用户绩效汇总")
|
||||
public BaseResponse<Long> addUserPerformanceSummary(@Valid @RequestBody UserPerformanceSummaryAddRequest userPerformanceSummaryAddRequest) {
|
||||
UserPerformanceSummary userPerformanceSummary = commonService.copyProperties(userPerformanceSummaryAddRequest, UserPerformanceSummary.class);
|
||||
userPerformanceSummaryService.save(userPerformanceSummary);
|
||||
return ResultUtils.success(userPerformanceSummary.getId());
|
||||
}
|
||||
|
||||
/**
|
||||
* web端管理员根据id修改用户绩效汇总信息
|
||||
* @param userPerformanceSummaryUpdateRequest 用户绩效汇总更新请求体
|
||||
* @return 是否更新成功
|
||||
*/
|
||||
@PostMapping("update")
|
||||
@Operation(summary = "web端管理员根据id修改用户绩效汇总信息", description = "参数:用户绩效汇总更新请求体,权限:管理员,方法名:updateUserPerformanceSummary")
|
||||
@RequiresPermission(mustRole = UserConstant.ADMIN_ROLE)
|
||||
@SysLog(title = "用户绩效汇总管理", content = "web端管理员根据id修改用户绩效汇总信息")
|
||||
public BaseResponse<Boolean> updateUserPerformanceSummary(@Valid @RequestBody UserPerformanceSummaryUpdateRequest userPerformanceSummaryUpdateRequest) {
|
||||
UserPerformanceSummary userPerformanceSummary = commonService.copyProperties(userPerformanceSummaryUpdateRequest, UserPerformanceSummary.class);
|
||||
userPerformanceSummaryService.updateById(userPerformanceSummary);
|
||||
return ResultUtils.success(true);
|
||||
}
|
||||
|
||||
/**
|
||||
* web端管理员根据id删除用户绩效汇总
|
||||
* @param commonRequest 用户绩效汇总删除请求体
|
||||
* @return 是否删除成功
|
||||
*/
|
||||
@PostMapping("delete")
|
||||
@Operation(summary = "web端管理员根据id删除用户绩效汇总", description = "参数:用户绩效汇总删除请求体,权限:管理员,方法名:delUserPerformanceSummary")
|
||||
@RequiresPermission(mustRole = UserConstant.ADMIN_ROLE)
|
||||
@SysLog(title = "用户绩效汇总管理", content = "web端管理员根据id删除用户绩效汇总")
|
||||
public BaseResponse<Boolean> delUserPerformanceSummary(@Valid @RequestBody CommonRequest commonRequest) {
|
||||
Long id = commonRequest.getId();
|
||||
userPerformanceSummaryService.removeById(id);
|
||||
return ResultUtils.success(true);
|
||||
}
|
||||
|
||||
/**
|
||||
* web端管理员批量删除用户绩效汇总
|
||||
* @param commonBatchRequest 用户绩效汇总批量删除请求体
|
||||
* @return 是否删除成功
|
||||
*/
|
||||
@PostMapping("delBatch")
|
||||
@Operation(summary = "web端管理员批量删除用户绩效汇总", description = "参数:用户绩效汇总批量删除请求体,权限:管理员,方法名:delBatchUserPerformanceSummary")
|
||||
@RequiresPermission(mustRole = UserConstant.ADMIN_ROLE)
|
||||
@SysLog(title = "用户绩效汇总管理", content = "web端管理员批量删除用户绩效汇总")
|
||||
public BaseResponse<Boolean> delBatchUserPerformanceSummary(@Valid @RequestBody CommonBatchRequest commonBatchRequest) {
|
||||
List<Long> ids = commonBatchRequest.getIds();
|
||||
userPerformanceSummaryService.removeByIds(ids);
|
||||
return ResultUtils.success(true);
|
||||
}
|
||||
|
||||
/**
|
||||
* web端管理员根据id查询用户绩效汇总
|
||||
* @param commonRequest 用户绩效汇总查询请求体
|
||||
* @return 用户绩效汇总信息
|
||||
*/
|
||||
@PostMapping("queryById")
|
||||
@Operation(summary = "web端管理员根据id查询用户绩效汇总", description = "参数:用户绩效汇总查询请求体,权限:管理员,方法名:queryUserPerformanceSummaryById")
|
||||
@RequiresPermission(mustRole = UserConstant.ADMIN_ROLE)
|
||||
@SysLog(title = "用户绩效汇总管理", content = "web端管理员根据id查询用户绩效汇总")
|
||||
public BaseResponse<UserPerformanceSummaryVO> queryUserPerformanceSummaryById(@Valid @RequestBody CommonRequest commonRequest) {
|
||||
Long id = commonRequest.getId();
|
||||
UserPerformanceSummary userPerformanceSummary = userPerformanceSummaryService.getById(id);
|
||||
UserPerformanceSummaryVO userPerformanceSummaryVO = commonService.copyProperties(userPerformanceSummary, UserPerformanceSummaryVO.class);
|
||||
return ResultUtils.success(userPerformanceSummaryVO);
|
||||
}
|
||||
|
||||
// /**
|
||||
// * Web端管理员分页查询用户绩效汇总
|
||||
// * @param userPerformanceSummaryQueryRequest 用户绩效汇总查询请求体
|
||||
// * @return 用户绩效汇总列表
|
||||
// */
|
||||
// @PostMapping("page")
|
||||
// @Operation(summary = "Web端管理员分页查询用户绩效汇总", description = "参数:用户绩效汇总查询请求体,权限:管理员,方法名:listUserPerformanceSummaryByPage")
|
||||
// @RequiresPermission(mustRole = UserConstant.ADMIN_ROLE)
|
||||
// @SysLog(title = "用户绩效汇总管理", content = "Web端管理员分页查询用户绩效汇总")
|
||||
// public BaseResponse<Page<UserPerformanceSummaryVO>> listUserPerformanceSummaryByPage(@Valid @RequestBody UserPerformanceSummaryQueryRequest userPerformanceSummaryQueryRequest) {
|
||||
// long current = userPerformanceSummaryQueryRequest.getCurrent();
|
||||
// long pageSize = userPerformanceSummaryQueryRequest.getPageSize();
|
||||
// QueryWrapper<UserPerformanceSummary> queryWrapper = userPerformanceSummaryService.getQueryWrapper(userPerformanceSummaryQueryRequest);
|
||||
// Page<UserPerformanceSummary> page = userPerformanceSummaryService.page(new Page<>(current, pageSize), queryWrapper);
|
||||
// List<UserPerformanceSummary> userPerformanceSummaryList = page.getRecords();
|
||||
// List<UserPerformanceSummaryVO> userPerformanceSummaryVOList = commonService.convertList(userPerformanceSummaryList, UserPerformanceSummaryVO.class);
|
||||
// Page<UserPerformanceSummaryVO> voPage = new Page<>(current, pageSize);
|
||||
// voPage.setRecords(userPerformanceSummaryVOList);
|
||||
// voPage.setPages(page.getPages());
|
||||
// voPage.setTotal(page.getTotal());
|
||||
// return ResultUtils.success(voPage);
|
||||
// }
|
||||
}
|
@ -27,13 +27,13 @@ public class Generator {
|
||||
// 作者
|
||||
private static final String AUTHOR = "chenxinzhi";
|
||||
// 表注释
|
||||
private static final String TABLE_COMMENT = "课程推广待提成记录";
|
||||
private static final String TABLE_COMMENT = "用户绩效汇总";
|
||||
// 实体类名
|
||||
private static final String ENTITY_NAME = "CoursePromotionCommissionPending";
|
||||
private static final String ENTITY_NAME = "UserPerformanceSummary";
|
||||
// 表名
|
||||
private static final String TABLE_NAME = "course_promotion_commission_pending";
|
||||
private static final String TABLE_NAME = "user_performance_summary";
|
||||
// 实体类属性名
|
||||
private static final String ENTITY_NAME_LOWER = "coursePromotionCommissionPending";
|
||||
private static final String ENTITY_NAME_LOWER = "userPerformanceSummary";
|
||||
|
||||
// 父包名
|
||||
private static final String PARENT_PATH = "com.greenorange.promotion";
|
||||
|
@ -0,0 +1,18 @@
|
||||
package com.greenorange.promotion.mapper;
|
||||
|
||||
import com.greenorange.promotion.model.entity.UserPerformanceSummary;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
|
||||
/**
|
||||
* @author 35880
|
||||
* @description 针对表【user_performance_summary(用户绩效汇总表)】的数据库操作Mapper
|
||||
* @createDate 2025-07-10 20:38:41
|
||||
* @Entity com.greenorange.promotion.model.entity.UserPerformanceSummary
|
||||
*/
|
||||
public interface UserPerformanceSummaryMapper extends BaseMapper<UserPerformanceSummary> {
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
@ -29,19 +29,11 @@ public class AdvancementApplyApproveRequest implements Serializable {
|
||||
private Long applyId;
|
||||
|
||||
/**
|
||||
* 邀请码
|
||||
* 用户id
|
||||
*/
|
||||
@NotBlank(message = "邀请码不能为空")
|
||||
@Schema(description = "邀请码", example = "666999")
|
||||
private String invitationCode;
|
||||
|
||||
/**
|
||||
* 用户角色
|
||||
*/
|
||||
@NotBlank(message = "用户角色不能为空")
|
||||
@EnumValue(enumClass = UserRoleEnum.class)
|
||||
@Schema(description = "用户角色", example = "user")
|
||||
private String userRole;
|
||||
@Min(value = 1, message = "用户id不能小于1")
|
||||
@Schema(description = "用户id", example = "666999")
|
||||
private Long userId;
|
||||
|
||||
|
||||
@Serial
|
||||
|
@ -0,0 +1,60 @@
|
||||
package com.greenorange.promotion.model.dto.userInfo;
|
||||
|
||||
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 = {"id", "nickName", "userAvatar",
|
||||
"phoneNumber", "userPassword"})
|
||||
public class ManagerUserInfoUpdateRequest implements Serializable {
|
||||
|
||||
/**
|
||||
* 用户表 ID
|
||||
*/
|
||||
@Min(value = 1L, message = "用户ID不能小于1")
|
||||
@Schema(description = "用户ID", example = "1")
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 用户昵称
|
||||
*/
|
||||
@NotBlank(message = "用户昵称不能为空")
|
||||
@Schema(description = "用户昵称", example = "chenxinzhi")
|
||||
private String nickName;
|
||||
|
||||
/**
|
||||
* 用户头像URL
|
||||
*/
|
||||
@NotBlank(message = "用户头像URL不能为空")
|
||||
@Schema(description = "用户头像URL", example = "http://xxx.png")
|
||||
private String userAvatar;
|
||||
|
||||
/**
|
||||
* 手机号
|
||||
*/
|
||||
@NotBlank(message = "手机号不能为空")
|
||||
@Schema(description = "手机号", example = "15888610253")
|
||||
private String phoneNumber;
|
||||
|
||||
|
||||
/**
|
||||
* 密码(建议加密存储)
|
||||
*/
|
||||
@NotBlank(message = "密码不能为空")
|
||||
@Schema(description = "密码(建议加密存储)", example = "qingcheng")
|
||||
private String userPassword;
|
||||
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
}
|
@ -1,5 +1,7 @@
|
||||
package com.greenorange.promotion.model.dto.userInfo;
|
||||
|
||||
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.NotBlank;
|
||||
import jakarta.validation.constraints.Size;
|
||||
@ -30,6 +32,15 @@ public class UserInfoMiniPasswordLoginRequest implements Serializable {
|
||||
@Schema(description = "密码(建议加密存储)", example = "qingcheng")
|
||||
private String userPassword;
|
||||
|
||||
/**
|
||||
* 权限
|
||||
*/
|
||||
@NotBlank(message = "权限不能为空")
|
||||
@EnumValue(enumClass = UserRoleEnum.class)
|
||||
@Schema(description = "权限", example = "user")
|
||||
private String userRole;
|
||||
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
|
@ -1,7 +1,11 @@
|
||||
package com.greenorange.promotion.model.dto.userInfo;
|
||||
|
||||
import com.greenorange.promotion.annotation.BaseEnum;
|
||||
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;
|
||||
@ -28,6 +32,15 @@ public class UserInfoQueryRequest extends PageRequest implements Serializable {
|
||||
private String phoneNumber;
|
||||
|
||||
|
||||
/**
|
||||
* 权限
|
||||
*/
|
||||
@NotBlank(message = "权限不能为空")
|
||||
@EnumValue(enumClass = UserRoleEnum.class)
|
||||
@Schema(description = "权限", example = "admin")
|
||||
private String userRole;
|
||||
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
}
|
||||
|
@ -1,5 +1,7 @@
|
||||
package com.greenorange.promotion.model.dto.userInfo;
|
||||
|
||||
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.NotBlank;
|
||||
import jakarta.validation.constraints.Pattern;
|
||||
@ -56,6 +58,14 @@ public class UserInfoRegisterRequest implements Serializable {
|
||||
@Schema(description = "密码(建议加密存储)", example = "qingcheng")
|
||||
private String userPassword;
|
||||
|
||||
/**
|
||||
* 权限
|
||||
*/
|
||||
@NotBlank(message = "权限不能为空")
|
||||
@EnumValue(enumClass = UserRoleEnum.class)
|
||||
@Schema(description = "权限", example = "user")
|
||||
private String userRole;
|
||||
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
@ -1,5 +1,8 @@
|
||||
package com.greenorange.promotion.model.dto.userInfo;
|
||||
|
||||
import com.greenorange.promotion.annotation.EnumValue;
|
||||
import com.greenorange.promotion.constant.UserConstant;
|
||||
import com.greenorange.promotion.model.enums.UserRoleEnum;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import jakarta.validation.constraints.NotBlank;
|
||||
import jakarta.validation.constraints.Size;
|
||||
@ -16,7 +19,7 @@ import java.io.Serializable;
|
||||
*/
|
||||
@Data
|
||||
@Schema(description = "小程序用户信息重置请求体", requiredProperties =
|
||||
{"phoneNumber", "verificationCode", "userPassword", "userConfirmPassword"})
|
||||
{"phoneNumber", "verificationCode", "userPassword", "userConfirmPassword, userRole"})
|
||||
public class UserInfoResetRequest implements Serializable {
|
||||
|
||||
/**
|
||||
@ -55,6 +58,14 @@ public class UserInfoResetRequest implements Serializable {
|
||||
@Schema(description = "token(内部重置使用)", example = "eyJhbGciOiJIUzI1NiJ9.eyJzdWIiOiJhZG1pbiIsImlhdCI6MTY5MjE5MzE5NywiZXhwIjoxNjkyMTk3Nzk3fQ.Q_5Y5Z")
|
||||
private String sourceToken;
|
||||
|
||||
/**
|
||||
* 权限
|
||||
*/
|
||||
@NotBlank(message = "权限不能为空")
|
||||
@EnumValue(enumClass = UserRoleEnum.class)
|
||||
@Schema(description = "权限", example = "user")
|
||||
private String userRole;
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
}
|
||||
|
@ -0,0 +1,102 @@
|
||||
package com.greenorange.promotion.model.dto.userPerformanceSummary;
|
||||
|
||||
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 = {
|
||||
"totalAmount",
|
||||
"netAmount",
|
||||
"promoCount",
|
||||
"superCount",
|
||||
"empCount",
|
||||
"orderCount",
|
||||
"toRelease",
|
||||
"toSettle",
|
||||
"settled",
|
||||
"refunded",
|
||||
"userId",
|
||||
})
|
||||
public class UserPerformanceSummaryAddRequest implements Serializable {
|
||||
|
||||
/**
|
||||
* 订单总金额
|
||||
*/
|
||||
@Schema(description = "订单总金额", example = "")
|
||||
private BigDecimal totalAmount;
|
||||
|
||||
/**
|
||||
* 净成交
|
||||
*/
|
||||
@Schema(description = "净成交", example = "")
|
||||
private BigDecimal netAmount;
|
||||
|
||||
/**
|
||||
* 推广人数
|
||||
*/
|
||||
@Schema(description = "推广人数", example = "")
|
||||
private Integer promoCount;
|
||||
|
||||
/**
|
||||
* 主管数量
|
||||
*/
|
||||
@Schema(description = "主管数量", example = "")
|
||||
private Integer superCount;
|
||||
|
||||
/**
|
||||
* 员工数量
|
||||
*/
|
||||
@Schema(description = "员工数量", example = "")
|
||||
private Integer empCount;
|
||||
|
||||
/**
|
||||
* 下单数量
|
||||
*/
|
||||
@Schema(description = "下单数量", example = "")
|
||||
private Integer orderCount;
|
||||
|
||||
/**
|
||||
* 待释放
|
||||
*/
|
||||
@Schema(description = "待释放", example = "")
|
||||
private BigDecimal toRelease;
|
||||
|
||||
/**
|
||||
* 可结算
|
||||
*/
|
||||
@Schema(description = "可结算", example = "")
|
||||
private BigDecimal toSettle;
|
||||
|
||||
/**
|
||||
* 已结算
|
||||
*/
|
||||
@Schema(description = "已结算", example = "")
|
||||
private BigDecimal settled;
|
||||
|
||||
/**
|
||||
* 已回退
|
||||
*/
|
||||
@Schema(description = "已回退", example = "")
|
||||
private BigDecimal refunded;
|
||||
|
||||
/**
|
||||
* 用户id
|
||||
*/
|
||||
@Min(value = 1L, message = "用户id ID不能小于1")
|
||||
@Schema(description = "用户id", example = "")
|
||||
private Long userId;
|
||||
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
}
|
||||
|
@ -0,0 +1,98 @@
|
||||
package com.greenorange.promotion.model.dto.userPerformanceSummary;
|
||||
|
||||
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 UserPerformanceSummaryQueryRequest extends PageRequest implements Serializable {
|
||||
|
||||
/**
|
||||
* 用户ID
|
||||
*/
|
||||
@Min(value = 1L, message = "用户ID ID不能小于1")
|
||||
@Schema(description = "用户ID", example = "")
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 订单总金额
|
||||
*/
|
||||
@Schema(description = "订单总金额", example = "")
|
||||
private BigDecimal totalAmount;
|
||||
|
||||
/**
|
||||
* 净成交
|
||||
*/
|
||||
@Schema(description = "净成交", example = "")
|
||||
private BigDecimal netAmount;
|
||||
|
||||
/**
|
||||
* 推广人数
|
||||
*/
|
||||
@Schema(description = "推广人数", example = "")
|
||||
private Integer promoCount;
|
||||
|
||||
/**
|
||||
* 主管数量
|
||||
*/
|
||||
@Schema(description = "主管数量", example = "")
|
||||
private Integer superCount;
|
||||
|
||||
/**
|
||||
* 员工数量
|
||||
*/
|
||||
@Schema(description = "员工数量", example = "")
|
||||
private Integer empCount;
|
||||
|
||||
/**
|
||||
* 下单数量
|
||||
*/
|
||||
@Schema(description = "下单数量", example = "")
|
||||
private Integer orderCount;
|
||||
|
||||
/**
|
||||
* 待释放
|
||||
*/
|
||||
@Schema(description = "待释放", example = "")
|
||||
private BigDecimal toRelease;
|
||||
|
||||
/**
|
||||
* 可结算
|
||||
*/
|
||||
@Schema(description = "可结算", example = "")
|
||||
private BigDecimal toSettle;
|
||||
|
||||
/**
|
||||
* 已结算
|
||||
*/
|
||||
@Schema(description = "已结算", example = "")
|
||||
private BigDecimal settled;
|
||||
|
||||
/**
|
||||
* 已回退
|
||||
*/
|
||||
@Schema(description = "已回退", example = "")
|
||||
private BigDecimal refunded;
|
||||
|
||||
/**
|
||||
* 用户id
|
||||
*/
|
||||
@Min(value = 1L, message = "用户id ID不能小于1")
|
||||
@Schema(description = "用户id", example = "")
|
||||
private Long userId;
|
||||
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
}
|
||||
|
@ -0,0 +1,103 @@
|
||||
package com.greenorange.promotion.model.dto.userPerformanceSummary;
|
||||
|
||||
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",
|
||||
"totalAmount",
|
||||
"netAmount",
|
||||
"promoCount",
|
||||
"superCount",
|
||||
"empCount",
|
||||
"orderCount",
|
||||
"toRelease",
|
||||
"toSettle",
|
||||
"settled",
|
||||
"refunded",
|
||||
"userId",
|
||||
})
|
||||
public class UserPerformanceSummaryUpdateRequest implements Serializable {
|
||||
|
||||
/**
|
||||
* 用户ID
|
||||
*/
|
||||
@Min(value = 1L, message = "用户ID ID不能小于1")
|
||||
@Schema(description = "用户ID", example = "")
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 订单总金额
|
||||
*/
|
||||
@Schema(description = "订单总金额", example = "")
|
||||
private BigDecimal totalAmount;
|
||||
|
||||
/**
|
||||
* 净成交
|
||||
*/
|
||||
@Schema(description = "净成交", example = "")
|
||||
private BigDecimal netAmount;
|
||||
|
||||
/**
|
||||
* 推广人数
|
||||
*/
|
||||
@Schema(description = "推广人数", example = "")
|
||||
private Integer promoCount;
|
||||
|
||||
/**
|
||||
* 员工数量
|
||||
*/
|
||||
@Schema(description = "员工数量", example = "")
|
||||
private Integer empCount;
|
||||
|
||||
/**
|
||||
* 下单数量
|
||||
*/
|
||||
@Schema(description = "下单数量", example = "")
|
||||
private Integer orderCount;
|
||||
|
||||
/**
|
||||
* 待释放
|
||||
*/
|
||||
@Schema(description = "待释放", example = "")
|
||||
private BigDecimal toRelease;
|
||||
|
||||
/**
|
||||
* 可结算
|
||||
*/
|
||||
@Schema(description = "可结算", example = "")
|
||||
private BigDecimal toSettle;
|
||||
|
||||
/**
|
||||
* 已结算
|
||||
*/
|
||||
@Schema(description = "已结算", example = "")
|
||||
private BigDecimal settled;
|
||||
|
||||
/**
|
||||
* 已回退
|
||||
*/
|
||||
@Schema(description = "已回退", example = "")
|
||||
private BigDecimal refunded;
|
||||
|
||||
/**
|
||||
* 用户id
|
||||
*/
|
||||
@Min(value = 1L, message = "用户id ID不能小于1")
|
||||
@Schema(description = "用户id", example = "")
|
||||
private Long userId;
|
||||
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
}
|
@ -0,0 +1,97 @@
|
||||
package com.greenorange.promotion.model.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import java.io.Serializable;
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* 用户绩效汇总表
|
||||
* @TableName user_performance_summary
|
||||
*/
|
||||
@TableName(value ="user_performance_summary")
|
||||
@Data
|
||||
public class UserPerformanceSummary implements Serializable {
|
||||
/**
|
||||
* 用户ID
|
||||
*/
|
||||
@TableId
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 订单总金额
|
||||
*/
|
||||
private BigDecimal totalAmount;
|
||||
|
||||
/**
|
||||
* 净成交
|
||||
*/
|
||||
private BigDecimal netAmount;
|
||||
|
||||
/**
|
||||
* 推广人数
|
||||
*/
|
||||
private Integer promoCount;
|
||||
|
||||
/**
|
||||
* 主管数量
|
||||
*/
|
||||
private Integer superCount;
|
||||
|
||||
/**
|
||||
* 员工数量
|
||||
*/
|
||||
private Integer empCount;
|
||||
|
||||
/**
|
||||
* 下单数量
|
||||
*/
|
||||
private Integer orderCount;
|
||||
|
||||
/**
|
||||
* 待释放
|
||||
*/
|
||||
private BigDecimal toRelease;
|
||||
|
||||
/**
|
||||
* 可结算
|
||||
*/
|
||||
private BigDecimal toSettle;
|
||||
|
||||
/**
|
||||
* 已结算
|
||||
*/
|
||||
private BigDecimal settled;
|
||||
|
||||
/**
|
||||
* 已回退
|
||||
*/
|
||||
private BigDecimal refunded;
|
||||
|
||||
/**
|
||||
* 用户id
|
||||
*/
|
||||
private Long userId;
|
||||
|
||||
/**
|
||||
* 是否删除
|
||||
*/
|
||||
private Integer isDelete;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
private Date createTime;
|
||||
|
||||
/**
|
||||
* 更新时间
|
||||
*/
|
||||
private Date updateTime;
|
||||
|
||||
@TableField(exist = false)
|
||||
private static final long serialVersionUID = 1L;
|
||||
}
|
@ -37,12 +37,6 @@ public class AdvancementApplyApproveVO implements Serializable {
|
||||
@Schema(description = "拒绝理由", example = "无")
|
||||
private String rejectReason;
|
||||
|
||||
/**
|
||||
* 账号
|
||||
*/
|
||||
@Schema(description = "账号", example = "qingcheng")
|
||||
private String userAccount;
|
||||
|
||||
|
||||
/**
|
||||
* 密码(建议加密存储)
|
||||
@ -51,6 +45,13 @@ public class AdvancementApplyApproveVO implements Serializable {
|
||||
private String userPassword;
|
||||
|
||||
|
||||
/**
|
||||
* 用户权限
|
||||
*/
|
||||
@Schema(description = "用户权限", example = "user")
|
||||
private String userRole;
|
||||
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
|
@ -0,0 +1,52 @@
|
||||
package com.greenorange.promotion.model.vo.userInfo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serial;
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* 经理信息 视图对象
|
||||
*/
|
||||
@Data
|
||||
@Schema(description = "经理信息 视图对象")
|
||||
public class ManagerUserInfoVO implements Serializable {
|
||||
|
||||
/**
|
||||
* 用户表 ID
|
||||
*/
|
||||
@Schema(description = "用户ID", example = "1")
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 用户昵称
|
||||
*/
|
||||
@Schema(description = "用户昵称", example = "chenxinzhi")
|
||||
private String nickName;
|
||||
|
||||
/**
|
||||
* 用户头像URL
|
||||
*/
|
||||
@Schema(description = "用户头像URL", example = "http://xxx.png")
|
||||
private String userAvatar;
|
||||
|
||||
/**
|
||||
* 手机号
|
||||
*/
|
||||
@Schema(description = "手机号", example = "15888610253")
|
||||
private String phoneNumber;
|
||||
|
||||
|
||||
/**
|
||||
* 密码(建议加密存储)
|
||||
*/
|
||||
@Schema(description = "密码(建议加密存储)", example = "qingcheng")
|
||||
private String userPassword;
|
||||
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
|
||||
}
|
@ -0,0 +1,92 @@
|
||||
package com.greenorange.promotion.model.vo.userPerformanceSummary;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serial;
|
||||
import java.io.Serializable;
|
||||
import java.math.BigDecimal;
|
||||
|
||||
/**
|
||||
* 用户绩效汇总 视图对象
|
||||
*/
|
||||
@Data
|
||||
@Schema(description = "用户绩效汇总 视图对象")
|
||||
public class UserPerformanceSummaryVO implements Serializable {
|
||||
|
||||
/**
|
||||
* 用户绩效汇总ID
|
||||
*/
|
||||
@Schema(description = "用户绩效汇总ID", example = "1")
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 订单总金额
|
||||
*/
|
||||
@Schema(description = "订单总金额", example = "")
|
||||
private BigDecimal totalAmount;
|
||||
|
||||
/**
|
||||
* 净成交
|
||||
*/
|
||||
@Schema(description = "净成交", example = "")
|
||||
private BigDecimal netAmount;
|
||||
|
||||
/**
|
||||
* 推广人数
|
||||
*/
|
||||
@Schema(description = "推广人数", example = "")
|
||||
private Integer promoCount;
|
||||
|
||||
/**
|
||||
* 主管数量
|
||||
*/
|
||||
@Schema(description = "主管数量", example = "")
|
||||
private Integer superCount;
|
||||
|
||||
/**
|
||||
* 员工数量
|
||||
*/
|
||||
@Schema(description = "员工数量", example = "")
|
||||
private Integer empCount;
|
||||
|
||||
/**
|
||||
* 下单数量
|
||||
*/
|
||||
@Schema(description = "下单数量", example = "")
|
||||
private Integer orderCount;
|
||||
|
||||
/**
|
||||
* 待释放
|
||||
*/
|
||||
@Schema(description = "待释放", example = "")
|
||||
private BigDecimal toRelease;
|
||||
|
||||
/**
|
||||
* 可结算
|
||||
*/
|
||||
@Schema(description = "可结算", example = "")
|
||||
private BigDecimal toSettle;
|
||||
|
||||
/**
|
||||
* 已结算
|
||||
*/
|
||||
@Schema(description = "已结算", example = "")
|
||||
private BigDecimal settled;
|
||||
|
||||
/**
|
||||
* 已回退
|
||||
*/
|
||||
@Schema(description = "已回退", example = "")
|
||||
private BigDecimal refunded;
|
||||
|
||||
/**
|
||||
* 用户id
|
||||
*/
|
||||
@Schema(description = "用户id", example = "")
|
||||
private Long userId;
|
||||
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
}
|
@ -0,0 +1,13 @@
|
||||
package com.greenorange.promotion.service.userInfo;
|
||||
|
||||
import com.greenorange.promotion.model.entity.UserPerformanceSummary;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
|
||||
/**
|
||||
* @author 35880
|
||||
* @description 针对表【user_performance_summary(用户绩效汇总表)】的数据库操作Service
|
||||
* @createDate 2025-07-10 20:38:41
|
||||
*/
|
||||
public interface UserPerformanceSummaryService extends IService<UserPerformanceSummary> {
|
||||
|
||||
}
|
@ -26,6 +26,7 @@ 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.UserMainInfoService;
|
||||
import com.greenorange.promotion.service.userInfo.UserPerformanceSummaryService;
|
||||
import com.greenorange.promotion.service.wechat.WechatGetQrcodeService;
|
||||
import com.greenorange.promotion.utils.JWTUtils;
|
||||
import com.greenorange.promotion.utils.RegexUtils;
|
||||
@ -44,6 +45,7 @@ import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
import java.util.function.Function;
|
||||
|
||||
/**
|
||||
* @author 35880
|
||||
@ -94,6 +96,10 @@ public class UserInfoServiceImpl extends ServiceImpl<UserInfoMapper, UserInfo>
|
||||
private AdvancementApplyService advancementApplyService;
|
||||
|
||||
|
||||
@Resource
|
||||
private UserPerformanceSummaryService userPerformanceSummaryService;
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@ -105,11 +111,13 @@ public class UserInfoServiceImpl extends ServiceImpl<UserInfoMapper, UserInfo>
|
||||
public QueryWrapper<UserInfo> getQueryWrapper(UserInfoQueryRequest userInfoQueryRequest) {
|
||||
Long id = userInfoQueryRequest.getId();
|
||||
String phoneNumber = userInfoQueryRequest.getPhoneNumber();
|
||||
String userRole = userInfoQueryRequest.getUserRole();
|
||||
String sortField = userInfoQueryRequest.getSortField();
|
||||
String sortOrder = userInfoQueryRequest.getSortOrder();
|
||||
QueryWrapper<UserInfo> queryWrapper = new QueryWrapper<>();
|
||||
queryWrapper.eq(id != null, "id", id);
|
||||
queryWrapper.eq(StringUtils.isNotBlank(phoneNumber), "phoneNumber", phoneNumber);
|
||||
queryWrapper.eq(StringUtils.isNotBlank(userRole), "userRole", userRole);
|
||||
queryWrapper.orderBy(SqlUtils.validSortField(sortField), sortOrder.equals(CommonConstant.SORT_ORDER_ASC), sortField);
|
||||
return queryWrapper;
|
||||
}
|
||||
@ -150,8 +158,10 @@ public class UserInfoServiceImpl extends ServiceImpl<UserInfoMapper, UserInfo>
|
||||
public void userInfoMiniRegister(UserInfoRegisterRequest userInfoRegisterRequest) {
|
||||
String phoneNumber = userInfoRegisterRequest.getPhoneNumber();
|
||||
String verificationCode = userInfoRegisterRequest.getVerificationCode();
|
||||
String userRole = userInfoRegisterRequest.getUserRole();
|
||||
UserRoleEnum userRoleEnum = UserRoleEnum.getEnumByValue(userRole);
|
||||
// 校验用户手机号和验证码
|
||||
checkPhoneAndVerificationCode(phoneNumber, verificationCode, UserRoleEnum.USER);
|
||||
checkPhoneAndVerificationCode(phoneNumber, verificationCode, userRoleEnum);
|
||||
|
||||
// 根据邀请码获得上级用户信息
|
||||
String invitationCode = userInfoRegisterRequest.getInvitationCode();
|
||||
@ -162,18 +172,18 @@ public class UserInfoServiceImpl extends ServiceImpl<UserInfoMapper, UserInfo>
|
||||
myUserInfo.setParentUserId(parentUserInfo.getId());
|
||||
myUserInfo.setInvitationCode(RandomUtil.randomNumbers(6));
|
||||
myUserInfo.setUserAccount(phoneNumber);
|
||||
myUserInfo.setUserRole(UserConstant.DEFAULT_ROLE);
|
||||
myUserInfo.setUserRole(userRole);
|
||||
myUserInfo.setUserAvatar(UserConstant.USER_DEFAULT_AVATAR);
|
||||
this.save(myUserInfo);
|
||||
|
||||
// 批量更新父级用户团队人数
|
||||
UserMainInfo userMainInfo = updateParentUserInfoTeamCount(myUserInfo.getId());
|
||||
// 更新上级用户的数量
|
||||
updateParentUserInfoEmpCount(myUserInfo.getId(), userRoleEnum);
|
||||
|
||||
// 生成邀请二维码
|
||||
generateInvitationQrcode(userMainInfo, myUserInfo.getInvitationCode());
|
||||
generateInvitationQrcode(myUserInfo.getInvitationCode(), userRoleEnum);
|
||||
|
||||
// 批量保存当前用户的项目明细抽佣记录和下级用户项目明细抽佣记录
|
||||
saveBatchProjectCommissionAndSubUserProjectCommission(myUserInfo.getId(), parentUserInfo.getId());
|
||||
// // 批量保存当前用户的项目明细抽佣记录和下级用户项目明细抽佣记录
|
||||
// saveBatchProjectCommissionAndSubUserProjectCommission(myUserInfo.getId(), parentUserInfo.getId());
|
||||
}
|
||||
|
||||
|
||||
@ -186,8 +196,10 @@ public class UserInfoServiceImpl extends ServiceImpl<UserInfoMapper, UserInfo>
|
||||
String phoneNumber = userInfoMiniPasswordLoginRequest.getPhoneNumber();
|
||||
ThrowUtils.throwIf(RegexUtils.isPhoneInvalid(phoneNumber), ErrorCode.PARAMS_ERROR, "手机号格式无效");
|
||||
String userPassword = userInfoMiniPasswordLoginRequest.getUserPassword();
|
||||
String userRole = userInfoMiniPasswordLoginRequest.getUserRole();
|
||||
LambdaQueryWrapper<UserInfo> lambdaQueryWrapper = new LambdaQueryWrapper<>();
|
||||
lambdaQueryWrapper.eq(UserInfo::getPhoneNumber, phoneNumber);
|
||||
lambdaQueryWrapper.eq(UserInfo::getUserRole, userRole);
|
||||
UserInfo userInfo = this.getOne(lambdaQueryWrapper);
|
||||
ThrowUtils.throwIf(userInfo == null, ErrorCode.OPERATION_ERROR, "手机号未注册");
|
||||
lambdaQueryWrapper.eq(UserInfo::getUserPassword, userPassword);
|
||||
@ -241,8 +253,10 @@ public class UserInfoServiceImpl extends ServiceImpl<UserInfoMapper, UserInfo>
|
||||
ThrowUtils.throwIf(!userPassword.equals(userConfirmPassword), ErrorCode.OPERATION_ERROR, "两次密码不一致");
|
||||
|
||||
// 更新用户密码
|
||||
String userRole = userInfoResetRequest.getUserRole();
|
||||
LambdaUpdateWrapper<UserInfo> lambdaUpdateWrapper = new LambdaUpdateWrapper<>();
|
||||
lambdaUpdateWrapper.eq(UserInfo::getPhoneNumber, phoneNumber).set(UserInfo::getUserPassword, userPassword);
|
||||
lambdaUpdateWrapper.eq(UserInfo::getUserRole, userRole);
|
||||
this.update(lambdaUpdateWrapper);
|
||||
|
||||
if (isInner) {
|
||||
@ -353,31 +367,30 @@ public class UserInfoServiceImpl extends ServiceImpl<UserInfoMapper, UserInfo>
|
||||
ThrowUtils.throwIf(RegexUtils.isPhoneInvalid(phoneNumber), ErrorCode.PARAMS_ERROR, "手机号格式无效");
|
||||
|
||||
// 根据邀请码获得上级用户信息
|
||||
String invitationCode = advancementApplyApproveRequest.getInvitationCode();
|
||||
UserInfo parentUserInfo = getParentUserInfoByInvitationCode(invitationCode);
|
||||
Long userId = advancementApplyApproveRequest.getUserId();
|
||||
UserInfo parentUserInfo = this.getById(userId);
|
||||
|
||||
// 添加用户
|
||||
UserInfo myUserInfo = UserInfo.builder()
|
||||
.id(null)
|
||||
.nickName(advancementApply.getName())
|
||||
.phoneNumber(advancementApply.getPhone())
|
||||
.userAvatar(UserConstant.USER_DEFAULT_AVATAR)
|
||||
.userAccount(RandomUtil.randomNumbers(12))
|
||||
.userAccount(phoneNumber)
|
||||
.userPassword(RandomUtil.randomString(12))
|
||||
.invitationCode(RandomUtil.randomNumbers(6))
|
||||
.userRole(advancementApplyApproveRequest.getUserRole())
|
||||
.userRole(UserConstant.STAFF_ROLE)
|
||||
.parentUserId(parentUserInfo.getId())
|
||||
.build();
|
||||
this.save(myUserInfo);
|
||||
|
||||
// 批量更新父级用户团队人数
|
||||
UserMainInfo userMainInfo = updateParentUserInfoTeamCount(myUserInfo.getId());
|
||||
// 更新上级主管用户的员工数量和经理用户的员工数量
|
||||
updateParentUserInfoEmpCount(myUserInfo.getId(), UserRoleEnum.STAFF);
|
||||
|
||||
// 生成邀请二维码
|
||||
generateInvitationQrcode(userMainInfo, myUserInfo.getInvitationCode());
|
||||
generateInvitationQrcode(myUserInfo.getInvitationCode(), UserRoleEnum.STAFF);
|
||||
|
||||
// 批量保存当前用户的项目明细抽佣记录和下级用户项目明细抽佣记录
|
||||
saveBatchProjectCommissionAndSubUserProjectCommission(myUserInfo.getId(), parentUserInfo.getId());
|
||||
// // 批量保存当前用户的项目明细抽佣记录和下级用户项目明细抽佣记录
|
||||
// saveBatchProjectCommissionAndSubUserProjectCommission(myUserInfo.getId(), parentUserInfo.getId());
|
||||
|
||||
// 修改晋升申请记录的审核状态,并绑定申请成功的用户id
|
||||
LambdaUpdateWrapper<AdvancementApply> advancementApplyLambdaUpdateWrapper = new LambdaUpdateWrapper<>();
|
||||
@ -388,6 +401,25 @@ public class UserInfoServiceImpl extends ServiceImpl<UserInfoMapper, UserInfo>
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 更新上级用户的数量
|
||||
*/
|
||||
private void updateParentUserInfoEmpCount(Long userId, UserRoleEnum userRoleEnum) {
|
||||
List<Long> pathToRoot = findPathToRoot(userId);
|
||||
List<UserPerformanceSummary> userPerformanceSummaryList = commonService.findByFieldInTargetField(pathToRoot, userPerformanceSummaryService, Function.identity(), UserPerformanceSummary::getUserId);
|
||||
for (UserPerformanceSummary userPerformanceSummary : userPerformanceSummaryList) {
|
||||
if (userRoleEnum.equals(UserRoleEnum.USER)) {
|
||||
userPerformanceSummary.setPromoCount(userPerformanceSummary.getPromoCount() + 1);
|
||||
} else if (userRoleEnum.equals(UserRoleEnum.STAFF)) {
|
||||
userPerformanceSummary.setEmpCount(userPerformanceSummary.getEmpCount() + 1);
|
||||
} else if (userRoleEnum.equals(UserRoleEnum.SUPERVISOR)) {
|
||||
userPerformanceSummary.setSuperCount(userPerformanceSummary.getSuperCount() + 1);
|
||||
}
|
||||
}
|
||||
userPerformanceSummaryService.updateBatchById(userPerformanceSummaryList);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 获取小程序用户的查询条件
|
||||
*/
|
||||
@ -427,17 +459,16 @@ public class UserInfoServiceImpl extends ServiceImpl<UserInfoMapper, UserInfo>
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 生成邀请二维码
|
||||
*/
|
||||
private void generateInvitationQrcode(UserMainInfo userMainInfo, String invitationCode) {
|
||||
private void generateInvitationQrcode(String invitationCode, UserRoleEnum userRoleEnum) {
|
||||
try {
|
||||
String view = wechatGetQrcodeService.getWxQrCode(invitationCode);
|
||||
userMainInfo.setInviteQrCode(view);
|
||||
wechatGetQrcodeService.getWxQrCode(invitationCode, userRoleEnum);
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
userMainInfoService.save(userMainInfo);
|
||||
}
|
||||
|
||||
|
||||
|
@ -0,0 +1,22 @@
|
||||
package com.greenorange.promotion.service.userInfo.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.greenorange.promotion.model.entity.UserPerformanceSummary;
|
||||
import com.greenorange.promotion.service.userInfo.UserPerformanceSummaryService;
|
||||
import com.greenorange.promotion.mapper.UserPerformanceSummaryMapper;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
/**
|
||||
* @author 35880
|
||||
* @description 针对表【user_performance_summary(用户绩效汇总表)】的数据库操作Service实现
|
||||
* @createDate 2025-07-10 20:38:41
|
||||
*/
|
||||
@Service
|
||||
public class UserPerformanceSummaryServiceImpl extends ServiceImpl<UserPerformanceSummaryMapper, UserPerformanceSummary>
|
||||
implements UserPerformanceSummaryService{
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
@ -2,6 +2,7 @@ package com.greenorange.promotion.service.wechat;
|
||||
|
||||
import com.greenorange.promotion.config.WxAccessToken;
|
||||
import com.greenorange.promotion.model.dto.CommonRequest;
|
||||
import com.greenorange.promotion.model.enums.UserRoleEnum;
|
||||
import jakarta.servlet.http.HttpServletRequest;
|
||||
|
||||
import java.io.IOException;
|
||||
@ -23,7 +24,7 @@ public interface WechatGetQrcodeService {
|
||||
/**
|
||||
* 微信小程序获取二维码
|
||||
*/
|
||||
String getWxQrCode(String inviteCode) throws IOException;
|
||||
String getWxQrCode(String inviteCode, UserRoleEnum userRoleEnum) throws IOException;
|
||||
|
||||
|
||||
// /**
|
||||
|
@ -19,6 +19,7 @@ import com.greenorange.promotion.model.dto.CommonRequest;
|
||||
import com.greenorange.promotion.model.entity.Course;
|
||||
import com.greenorange.promotion.model.entity.FileInfo;
|
||||
import com.greenorange.promotion.model.entity.UserInfo;
|
||||
import com.greenorange.promotion.model.enums.UserRoleEnum;
|
||||
import com.greenorange.promotion.service.course.CourseService;
|
||||
import com.greenorange.promotion.service.file.FileInfoService;
|
||||
import com.greenorange.promotion.service.wechat.WechatGetQrcodeService;
|
||||
@ -110,7 +111,7 @@ public class WechatGetQrcodeServiceImpl implements WechatGetQrcodeService {
|
||||
*/
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public String getWxQrCode(String inviteCode) throws IOException {
|
||||
public String getWxQrCode(String inviteCode, UserRoleEnum userRoleEnum) throws IOException {
|
||||
String accessToken = (String) redisTemplate.opsForValue().get(ACCESS_TOKEN_KEY);
|
||||
if (accessToken == null) {
|
||||
accessToken = this.getAccessToken().getAccess_token();
|
||||
|
@ -16,6 +16,16 @@ spring:
|
||||
max-lifetime: 120000
|
||||
|
||||
|
||||
rabbitmq:
|
||||
host: 160.202.242.36
|
||||
port: 5672
|
||||
username: qingcheng
|
||||
password: cksys6509
|
||||
virtual-host: vhost-caozhe
|
||||
listener:
|
||||
simple:
|
||||
prefetch: 1
|
||||
|
||||
data:
|
||||
redis:
|
||||
port: 6379
|
||||
@ -82,12 +92,12 @@ wx:
|
||||
appId: wx61b63e27bddf4ea2
|
||||
#商户号
|
||||
merchantId: 1700326544
|
||||
# #商户API私钥
|
||||
# privateKeyPath: apiclient_key.pem
|
||||
#商户API私钥
|
||||
privateKeyPath: apiclient_key.pem
|
||||
#商户证书序列号
|
||||
merchantSerialNumber: 6DC8953AB741D309920DA650B92F837BE38A2757
|
||||
# #商户APIv3密钥
|
||||
# apiV3Key: fbemuj4Xql7CYlQJAoTEPYxvPSNgYT2t
|
||||
#商户APIv3密钥
|
||||
apiV3Key: fbemuj4Xql7CYlQJAoTEPYxvPSNgYT2t
|
||||
#通知地址
|
||||
notifyUrl: https://winning-mouse-internally.ngrok-free.app
|
||||
#微信服务器地址
|
||||
|
@ -9,6 +9,16 @@ spring:
|
||||
max-lifetime: 120000
|
||||
|
||||
|
||||
rabbitmq:
|
||||
host: 160.202.242.36
|
||||
port: 5672
|
||||
username: qingcheng
|
||||
password: cksys6509
|
||||
virtual-host: vhost-test
|
||||
listener:
|
||||
simple:
|
||||
prefetch: 1
|
||||
|
||||
|
||||
data:
|
||||
redis:
|
||||
|
@ -13,7 +13,6 @@
|
||||
<result property="invitationCode" column="invitationCode" jdbcType="VARCHAR"/>
|
||||
<result property="userRole" column="userRole" jdbcType="OTHER"/>
|
||||
<result property="parentUserId" column="parentUserId" jdbcType="BIGINT"/>
|
||||
<result property="superUserList" column="superUserList" jdbcType="VARCHAR"/>
|
||||
<result property="isDelete" column="isDelete" jdbcType="TINYINT"/>
|
||||
<result property="createTime" column="createTime" jdbcType="TIMESTAMP"/>
|
||||
<result property="updateTime" column="updateTime" jdbcType="TIMESTAMP"/>
|
||||
|
31
src/main/resources/mapper/UserPerformanceSummaryMapper.xml
Normal file
31
src/main/resources/mapper/UserPerformanceSummaryMapper.xml
Normal file
@ -0,0 +1,31 @@
|
||||
<?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.UserPerformanceSummaryMapper">
|
||||
|
||||
<resultMap id="BaseResultMap" type="com.greenorange.promotion.model.entity.UserPerformanceSummary">
|
||||
<id property="id" column="id" jdbcType="BIGINT"/>
|
||||
<result property="totalAmount" column="totalAmount" jdbcType="DECIMAL"/>
|
||||
<result property="netAmount" column="netAmount" jdbcType="DECIMAL"/>
|
||||
<result property="promoCount" column="promoCount" jdbcType="INTEGER"/>
|
||||
<result property="empCount" column="empCount" jdbcType="INTEGER"/>
|
||||
<result property="orderCount" column="orderCount" jdbcType="INTEGER"/>
|
||||
<result property="toRelease" column="toRelease" jdbcType="DECIMAL"/>
|
||||
<result property="toSettle" column="toSettle" jdbcType="DECIMAL"/>
|
||||
<result property="settled" column="settled" jdbcType="DECIMAL"/>
|
||||
<result property="refunded" column="refunded" jdbcType="DECIMAL"/>
|
||||
<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,totalAmount,netAmount,
|
||||
promoCount,empCount,orderCount,
|
||||
toRelease,toSettle,settled,
|
||||
refunded,userId,isDelete,
|
||||
createTime,updateTime
|
||||
</sql>
|
||||
</mapper>
|
Reference in New Issue
Block a user