Compare commits
6 Commits
6544da8394
...
graduation
Author | SHA1 | Date | |
---|---|---|---|
ab6a124497 | |||
3fa9f1282e | |||
b007d0545d | |||
7634bc7385 | |||
64c1f2bf9a | |||
f189f53b2c |
@ -19,7 +19,7 @@ public interface SystemConstant {
|
|||||||
/**
|
/**
|
||||||
* 默认头像view值
|
* 默认头像view值
|
||||||
*/
|
*/
|
||||||
String DEFAULT_AVATAR_VIEW = "default-QU7P9SD5";
|
String DEFAULT_AVATAR_VIEW = "default-WKQ0M3LI";
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -1,5 +1,7 @@
|
|||||||
package com.greenorange.promotion.controller.course;
|
package com.greenorange.promotion.controller.course;
|
||||||
|
|
||||||
|
import cn.hutool.core.date.DateUnit;
|
||||||
|
import cn.hutool.core.date.DateUtil;
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||||
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
||||||
@ -47,6 +49,7 @@ import org.springframework.web.bind.annotation.RestController;
|
|||||||
|
|
||||||
import java.math.BigDecimal;
|
import java.math.BigDecimal;
|
||||||
import java.util.Collections;
|
import java.util.Collections;
|
||||||
|
import java.util.Date;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import java.util.function.Function;
|
import java.util.function.Function;
|
||||||
@ -208,6 +211,13 @@ public class CourseOrderController {
|
|||||||
Long id = commonRequest.getId();
|
Long id = commonRequest.getId();
|
||||||
CourseOrder courseOrder = courseOrderService.getById(id);
|
CourseOrder courseOrder = courseOrderService.getById(id);
|
||||||
|
|
||||||
|
// 判断是否超过7天
|
||||||
|
Date orderCreateTime = courseOrder.getCreateTime();
|
||||||
|
Date now = DateUtil.date();
|
||||||
|
// 计算两个时间相隔多少天(向下取整)
|
||||||
|
long days = DateUtil.between(orderCreateTime, now, DateUnit.DAY);
|
||||||
|
ThrowUtils.throwIf(days >= 7, ErrorCode.OPERATION_ERROR, "订单已超过7天,无法退款");
|
||||||
|
|
||||||
// 修改订单状态
|
// 修改订单状态
|
||||||
LambdaUpdateWrapper<CourseOrder> updateWrapper = new LambdaUpdateWrapper<>();
|
LambdaUpdateWrapper<CourseOrder> updateWrapper = new LambdaUpdateWrapper<>();
|
||||||
updateWrapper.eq(CourseOrder::getId, courseOrder.getId())
|
updateWrapper.eq(CourseOrder::getId, courseOrder.getId())
|
||||||
|
@ -156,6 +156,13 @@ public class ProjectDetailController {
|
|||||||
Long subUserId = subUserProjectCommission.getSubUserId();
|
Long subUserId = subUserProjectCommission.getSubUserId();
|
||||||
// 设置抽佣比例
|
// 设置抽佣比例
|
||||||
BigDecimal uniteRate = userCommissionRateMap.get(userId);
|
BigDecimal uniteRate = userCommissionRateMap.get(userId);
|
||||||
|
if (uniteRate == null && userId == 0) {
|
||||||
|
LambdaQueryWrapper<UserMainInfo> queryWrapper = new LambdaQueryWrapper<>();
|
||||||
|
queryWrapper.eq(UserMainInfo::getUserId, subUserId);
|
||||||
|
UserMainInfo userMainInfo = userMainInfoService.getOne(queryWrapper);
|
||||||
|
uniteRate = userMainInfo.getUniteRate().min(projectDetail.getMaxCommissionRate());
|
||||||
|
}
|
||||||
|
uniteRate = uniteRate.min(projectDetail.getMaxCommissionRate());
|
||||||
subUserProjectCommission.setCurrentCommissionRate(uniteRate);
|
subUserProjectCommission.setCurrentCommissionRate(uniteRate);
|
||||||
// 设置单价
|
// 设置单价
|
||||||
BigDecimal myUnitPrice = subUserProjectCommissionMap.get(userId);
|
BigDecimal myUnitPrice = subUserProjectCommissionMap.get(userId);
|
||||||
|
@ -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.core.conditions.update.LambdaUpdateWrapper;
|
||||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
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;
|
||||||
@ -10,12 +11,15 @@ import com.greenorange.promotion.common.ErrorCode;
|
|||||||
import com.greenorange.promotion.common.ResultUtils;
|
import com.greenorange.promotion.common.ResultUtils;
|
||||||
import com.greenorange.promotion.constant.UserConstant;
|
import com.greenorange.promotion.constant.UserConstant;
|
||||||
import com.greenorange.promotion.exception.ThrowUtils;
|
import com.greenorange.promotion.exception.ThrowUtils;
|
||||||
|
import com.greenorange.promotion.model.dto.CommonRequest;
|
||||||
import com.greenorange.promotion.model.dto.withdrawalApply.WithdrawalApplyAddRequest;
|
import com.greenorange.promotion.model.dto.withdrawalApply.WithdrawalApplyAddRequest;
|
||||||
import com.greenorange.promotion.model.dto.withdrawalApply.WithdrawalApplyQueryRequest;
|
import com.greenorange.promotion.model.dto.withdrawalApply.WithdrawalApplyQueryRequest;
|
||||||
|
import com.greenorange.promotion.model.dto.withdrawalApply.WithdrawalApplyReviewRequest;
|
||||||
import com.greenorange.promotion.model.entity.FundsChange;
|
import com.greenorange.promotion.model.entity.FundsChange;
|
||||||
import com.greenorange.promotion.model.entity.UserAccount;
|
import com.greenorange.promotion.model.entity.UserAccount;
|
||||||
import com.greenorange.promotion.model.entity.UserMainInfo;
|
import com.greenorange.promotion.model.entity.UserMainInfo;
|
||||||
import com.greenorange.promotion.model.entity.WithdrawalApply;
|
import com.greenorange.promotion.model.entity.WithdrawalApply;
|
||||||
|
import com.greenorange.promotion.model.enums.WithdrawStatusEnum;
|
||||||
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;
|
||||||
@ -173,6 +177,47 @@ public class WithdrawalApplyController {
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Web端管理员查看提现申请详情
|
||||||
|
* @param commonRequest 提现申请记录id
|
||||||
|
* @return 提现申请记录
|
||||||
|
*/
|
||||||
|
@PostMapping("get/id")
|
||||||
|
@Operation(summary = "Web端管理员查看提现申请详情", description = "参数:提现申请记录id,权限:管理员,方法名:queryWithdrawalApplyById")
|
||||||
|
@RequiresPermission(mustRole = UserConstant.ADMIN_ROLE)
|
||||||
|
// @SysLog(title = "提现申请记录管理", content = "Web端管理员分页查询提现申请记录")
|
||||||
|
public BaseResponse<WithdrawalApplyVO> queryWithdrawalApplyById(@Valid @RequestBody CommonRequest commonRequest) {
|
||||||
|
Long id = commonRequest.getId();
|
||||||
|
WithdrawalApply withdrawalApply = withdrawalApplyService.getById(id);
|
||||||
|
WithdrawalApplyVO withdrawalApplyVO = commonService.copyProperties(withdrawalApply, WithdrawalApplyVO.class);
|
||||||
|
return ResultUtils.success(withdrawalApplyVO);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Web端管理员审核提现申请
|
||||||
|
* @param withdrawalApplyReviewRequest 提现申请记录审核请求体
|
||||||
|
* @return 是否批准成功
|
||||||
|
*/
|
||||||
|
@PostMapping("review")
|
||||||
|
@Operation(summary = "Web端管理员审核提现申请", description = "参数:提现申请记录审核请求体,权限:管理员,方法名:approveWithdrawalApplyById")
|
||||||
|
@RequiresPermission(mustRole = UserConstant.ADMIN_ROLE)
|
||||||
|
// @SysLog(title = "提现申请记录管理", content = "Web端管理员分页查询提现申请记录")
|
||||||
|
public BaseResponse<Boolean> approveWithdrawalApplyById(@Valid @RequestBody WithdrawalApplyReviewRequest withdrawalApplyReviewRequest) {
|
||||||
|
Long id = withdrawalApplyReviewRequest.getId();
|
||||||
|
String withdrawalStatus = withdrawalApplyReviewRequest.getWithdrawalStatus();
|
||||||
|
WithdrawalApply withdrawalApply = withdrawalApplyService.getById(id);
|
||||||
|
ThrowUtils.throwIf(!withdrawalApply.getWithdrawalStatus().equals(WithdrawStatusEnum.PROCESSING.getValue()), ErrorCode.OPERATION_ERROR, "提现申请记录状态错误");
|
||||||
|
LambdaUpdateWrapper<WithdrawalApply> updateWrapper = new LambdaUpdateWrapper<>();
|
||||||
|
updateWrapper.eq(WithdrawalApply::getId, id).set(WithdrawalApply::getWithdrawalStatus, withdrawalStatus);
|
||||||
|
withdrawalApplyService.update(updateWrapper);
|
||||||
|
return ResultUtils.success(true);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Web端管理员分页查询提现申请记录
|
* Web端管理员分页查询提现申请记录
|
||||||
* @param withdrawalApplyQueryRequest 提现申请记录查询请求体
|
* @param withdrawalApplyQueryRequest 提现申请记录查询请求体
|
||||||
|
@ -513,14 +513,16 @@ public class UserPerformanceSummaryController {
|
|||||||
* 0 0 0 * * ?” = 每天 00:00:00 执行一次
|
* 0 0 0 * * ?” = 每天 00:00:00 执行一次
|
||||||
* @return 是否更新成功
|
* @return 是否更新成功
|
||||||
*/
|
*/
|
||||||
// @Scheduled(cron = "0 0 0 * * ?")
|
@Scheduled(cron = "0 0 0 * * ?")
|
||||||
@Scheduled(cron = "00 16 20 * * ?")
|
// @Scheduled(cron = "00 16 20 * * ?")
|
||||||
@Operation(summary = "轮询课程推广待提成记录表", description = "参数:无,权限:管理员,方法名:pollCourseOrder")
|
@Operation(summary = "轮询课程推广待提成记录表", description = "参数:无,权限:管理员,方法名:pollCourseOrder")
|
||||||
public void pollCourseOrder() {
|
public void pollCourseOrder() {
|
||||||
// 找出下单时间超过7天的订单,分别统计主管和员工的可结算金额
|
// 找出下单时间超过7天的订单,分别统计主管和员工的可结算金额
|
||||||
Map<Long, BigDecimal> toSettleMap = new HashMap<>();
|
Map<Long, BigDecimal> toSettleMap = new HashMap<>();
|
||||||
Map<Long, BigDecimal> totalAmountMap = new HashMap<>();
|
Map<Long, BigDecimal> totalAmountMap = new HashMap<>();
|
||||||
List<CoursePromotionCommissionPending> coursePromotionCommissionPendingList = commonService.findByFieldEqTargetField(CoursePromotionCommissionPending::getCommissionStatus, CommissionStatusEnum.PENDING.getValue(), coursePromotionCommissionPendingService);
|
List<CoursePromotionCommissionPending> coursePromotionCommissionPendingList = commonService.findByFieldEqTargetFieldWithSpecificFields(CoursePromotionCommissionPending::getCommissionStatus,
|
||||||
|
CommissionStatusEnum.PENDING.getValue(), coursePromotionCommissionPendingService, List.of(CoursePromotionCommissionPending::getId, CoursePromotionCommissionPending::getFirstUserId, CoursePromotionCommissionPending::getSecondUserId,
|
||||||
|
CoursePromotionCommissionPending::getTotalAmount, CoursePromotionCommissionPending::getFirstReward, CoursePromotionCommissionPending::getSecondReward));
|
||||||
for (CoursePromotionCommissionPending coursePromotionCommissionPending : coursePromotionCommissionPendingList) {
|
for (CoursePromotionCommissionPending coursePromotionCommissionPending : coursePromotionCommissionPendingList) {
|
||||||
Date orderCreateTime = coursePromotionCommissionPending.getOrderCreateTime();
|
Date orderCreateTime = coursePromotionCommissionPending.getOrderCreateTime();
|
||||||
Date now = DateUtil.date();
|
Date now = DateUtil.date();
|
||||||
@ -536,7 +538,9 @@ public class UserPerformanceSummaryController {
|
|||||||
}
|
}
|
||||||
coursePromotionCommissionPendingService.updateBatchById(coursePromotionCommissionPendingList);
|
coursePromotionCommissionPendingService.updateBatchById(coursePromotionCommissionPendingList);
|
||||||
// 修改用户绩效汇总表
|
// 修改用户绩效汇总表
|
||||||
List<UserPerformanceSummary> userPerformanceSummaryList = userPerformanceSummaryService.list();
|
LambdaQueryWrapper<UserPerformanceSummary> lambdaQueryWrapper = new LambdaQueryWrapper<>();
|
||||||
|
lambdaQueryWrapper.select(UserPerformanceSummary::getUserId, UserPerformanceSummary::getToRelease, UserPerformanceSummary::getToSettle, UserPerformanceSummary::getNetAmount, UserPerformanceSummary::getId);
|
||||||
|
List<UserPerformanceSummary> userPerformanceSummaryList = userPerformanceSummaryService.list(lambdaQueryWrapper);
|
||||||
for (UserPerformanceSummary userPerformanceSummary : userPerformanceSummaryList) {
|
for (UserPerformanceSummary userPerformanceSummary : userPerformanceSummaryList) {
|
||||||
Long userId = userPerformanceSummary.getUserId();
|
Long userId = userPerformanceSummary.getUserId();
|
||||||
BigDecimal toSettleAmount = toSettleMap.get(userId);
|
BigDecimal toSettleAmount = toSettleMap.get(userId);
|
||||||
|
@ -0,0 +1,40 @@
|
|||||||
|
package com.greenorange.promotion.model.dto.withdrawalApply;
|
||||||
|
|
||||||
|
import com.greenorange.promotion.annotation.EnumValue;
|
||||||
|
import com.greenorange.promotion.model.enums.WithdrawStatusEnum;
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import jakarta.validation.constraints.Min;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.io.Serial;
|
||||||
|
import java.io.Serializable;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 提现申请记录审核请求体
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@Schema(description = "提现申请记录审核请求体", requiredProperties = {
|
||||||
|
"id", "withdrawalStatus"
|
||||||
|
})
|
||||||
|
public class WithdrawalApplyReviewRequest implements Serializable {
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 提现申请ID
|
||||||
|
*/
|
||||||
|
@Min(value = 1L, message = "提现申请ID ID不能小于1")
|
||||||
|
@Schema(description = "提现申请ID", example = "1")
|
||||||
|
private Long id;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 提现状态[提现中(processing)|提现成功(success)|提现失败(failed)]
|
||||||
|
*/
|
||||||
|
@EnumValue(enumClass = WithdrawStatusEnum.class)
|
||||||
|
@Schema(description = "提现状态[提现中(processing)|提现成功(success)|提现失败(failed)]", example = "processing")
|
||||||
|
private String withdrawalStatus;
|
||||||
|
|
||||||
|
|
||||||
|
@Serial
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
}
|
@ -256,7 +256,7 @@ public class ProjectCommissionServiceImpl extends ServiceImpl<ProjectCommissionM
|
|||||||
|
|
||||||
LambdaQueryWrapper<ProjectCommission> projectCommissionLambdaQueryWrapper = new LambdaQueryWrapper<>();
|
LambdaQueryWrapper<ProjectCommission> projectCommissionLambdaQueryWrapper = new LambdaQueryWrapper<>();
|
||||||
projectCommissionLambdaQueryWrapper.eq(ProjectCommission::getUserId, userId);
|
projectCommissionLambdaQueryWrapper.eq(ProjectCommission::getUserId, userId);
|
||||||
projectCommissionLambdaQueryWrapper.select(ProjectCommission::getProjectDetailId);
|
projectCommissionLambdaQueryWrapper.select(ProjectCommission::getProjectDetailId, ProjectCommission::getId);
|
||||||
List<ProjectCommission> projectCommissionList = this.list(projectCommissionLambdaQueryWrapper);
|
List<ProjectCommission> projectCommissionList = this.list(projectCommissionLambdaQueryWrapper);
|
||||||
|
|
||||||
List<ProjectDetail> projectDetailList = commonService.findByFieldInTargetFieldWithSpecificFields(projectCommissionList, projectDetailService, ProjectCommission::getProjectDetailId, ProjectDetail::getId,
|
List<ProjectDetail> projectDetailList = commonService.findByFieldInTargetFieldWithSpecificFields(projectCommissionList, projectDetailService, ProjectCommission::getProjectDetailId, ProjectDetail::getId,
|
||||||
@ -287,7 +287,7 @@ public class ProjectCommissionServiceImpl extends ServiceImpl<ProjectCommissionM
|
|||||||
// 修改下级用户的项目明细抽佣比例
|
// 修改下级用户的项目明细抽佣比例
|
||||||
LambdaQueryWrapper<SubUserProjectCommission> subUserProjectCommissionLambdaQueryWrapper = new LambdaQueryWrapper<>();
|
LambdaQueryWrapper<SubUserProjectCommission> subUserProjectCommissionLambdaQueryWrapper = new LambdaQueryWrapper<>();
|
||||||
subUserProjectCommissionLambdaQueryWrapper.eq(SubUserProjectCommission::getUserId, userId);
|
subUserProjectCommissionLambdaQueryWrapper.eq(SubUserProjectCommission::getUserId, userId);
|
||||||
subUserProjectCommissionLambdaQueryWrapper.select(SubUserProjectCommission::getProjectDetailId);
|
subUserProjectCommissionLambdaQueryWrapper.select(SubUserProjectCommission::getProjectDetailId, SubUserProjectCommission::getId);
|
||||||
List<SubUserProjectCommission> subUserProjectCommissionList = subUserProjectCommissionService.list(subUserProjectCommissionLambdaQueryWrapper);
|
List<SubUserProjectCommission> subUserProjectCommissionList = subUserProjectCommissionService.list(subUserProjectCommissionLambdaQueryWrapper);
|
||||||
for (SubUserProjectCommission subUserProjectCommission : subUserProjectCommissionList) {
|
for (SubUserProjectCommission subUserProjectCommission : subUserProjectCommissionList) {
|
||||||
Long projectDetailId = subUserProjectCommission.getProjectDetailId();
|
Long projectDetailId = subUserProjectCommission.getProjectDetailId();
|
||||||
|
@ -223,9 +223,14 @@ public class UserInfoServiceImpl extends ServiceImpl<UserInfoMapper, UserInfo>
|
|||||||
|
|
||||||
// 生成邀请二维码
|
// 生成邀请二维码
|
||||||
String invitationQrcode = generateInvitationQrcode(myUserInfo.getInvitationCode(), userRoleEnum);
|
String invitationQrcode = generateInvitationQrcode(myUserInfo.getInvitationCode(), userRoleEnum);
|
||||||
|
|
||||||
|
// 添加用户主要信息
|
||||||
UserMainInfo userMainInfo = UserMainInfo.builder().userId(myUserInfo.getId()).inviteQrCode(invitationQrcode).build();
|
UserMainInfo userMainInfo = UserMainInfo.builder().userId(myUserInfo.getId()).inviteQrCode(invitationQrcode).build();
|
||||||
userMainInfoService.save(userMainInfo);
|
userMainInfoService.save(userMainInfo);
|
||||||
|
|
||||||
|
// 更新上级用户团队人数
|
||||||
|
updateParentUserInfoTeamCount(parentUserInfo.getId());
|
||||||
|
|
||||||
// 批量保存当前用户的项目明细抽佣记录和下级用户项目明细抽佣记录
|
// 批量保存当前用户的项目明细抽佣记录和下级用户项目明细抽佣记录
|
||||||
saveBatchProjectCommissionAndSubUserProjectCommission(myUserInfo.getId(), parentUserInfo.getId());
|
saveBatchProjectCommissionAndSubUserProjectCommission(myUserInfo.getId(), parentUserInfo.getId());
|
||||||
}
|
}
|
||||||
@ -363,7 +368,7 @@ public class UserInfoServiceImpl extends ServiceImpl<UserInfoMapper, UserInfo>
|
|||||||
// 判断手机号是否已注册
|
// 判断手机号是否已注册
|
||||||
LambdaQueryWrapper<UserInfo> lambdaQueryWrapper = new LambdaQueryWrapper<>();
|
LambdaQueryWrapper<UserInfo> lambdaQueryWrapper = new LambdaQueryWrapper<>();
|
||||||
UserRoleEnum userRoleEnum = UserRoleEnum.getEnumByValue(userRole);
|
UserRoleEnum userRoleEnum = UserRoleEnum.getEnumByValue(userRole);
|
||||||
if (userRoleEnum == UserRoleEnum.USER) {
|
if (UserRoleEnum.USER.equals(userRoleEnum)) {
|
||||||
lambdaQueryWrapper.eq(UserInfo::getUserRole, UserConstant.DEFAULT_ROLE);
|
lambdaQueryWrapper.eq(UserInfo::getUserRole, UserConstant.DEFAULT_ROLE);
|
||||||
} else {
|
} else {
|
||||||
lambdaQueryWrapper.in(UserInfo::getUserRole, UserConstant.STAFF_ROLE, UserConstant.SUPERVISOR_ROLE, UserConstant.MANAGER_ROLE);
|
lambdaQueryWrapper.in(UserInfo::getUserRole, UserConstant.STAFF_ROLE, UserConstant.SUPERVISOR_ROLE, UserConstant.MANAGER_ROLE);
|
||||||
@ -461,11 +466,16 @@ public class UserInfoServiceImpl extends ServiceImpl<UserInfoMapper, UserInfo>
|
|||||||
|
|
||||||
// 生成邀请二维码
|
// 生成邀请二维码
|
||||||
String invitationQrcode = generateInvitationQrcode(myUserInfo.getInvitationCode(), UserRoleEnum.STAFF);
|
String invitationQrcode = generateInvitationQrcode(myUserInfo.getInvitationCode(), UserRoleEnum.STAFF);
|
||||||
|
|
||||||
|
// 添加用户主要信息
|
||||||
UserMainInfo userMainInfo = UserMainInfo.builder().userId(myUserInfo.getId()).inviteQrCode(invitationQrcode).build();
|
UserMainInfo userMainInfo = UserMainInfo.builder().userId(myUserInfo.getId()).inviteQrCode(invitationQrcode).build();
|
||||||
userMainInfoService.save(userMainInfo);
|
userMainInfoService.save(userMainInfo);
|
||||||
|
|
||||||
// // 批量保存当前用户的项目明细抽佣记录和下级用户项目明细抽佣记录
|
// 更新上级用户团队人数
|
||||||
// saveBatchProjectCommissionAndSubUserProjectCommission(myUserInfo.getId(), parentUserInfo.getId());
|
updateParentUserInfoTeamCount(parentUserInfo.getId());
|
||||||
|
|
||||||
|
// 批量保存当前用户的项目明细抽佣记录和下级用户项目明细抽佣记录
|
||||||
|
saveBatchProjectCommissionAndSubUserProjectCommission(myUserInfo.getId(), parentUserInfo.getId());
|
||||||
|
|
||||||
// 修改晋升申请记录的审核状态,并绑定申请成功的用户id
|
// 修改晋升申请记录的审核状态,并绑定申请成功的用户id
|
||||||
LambdaUpdateWrapper<AdvancementApply> advancementApplyLambdaUpdateWrapper = new LambdaUpdateWrapper<>();
|
LambdaUpdateWrapper<AdvancementApply> advancementApplyLambdaUpdateWrapper = new LambdaUpdateWrapper<>();
|
||||||
@ -513,7 +523,7 @@ public class UserInfoServiceImpl extends ServiceImpl<UserInfoMapper, UserInfo>
|
|||||||
@Override
|
@Override
|
||||||
public LambdaQueryWrapper<UserInfo> getMiniUserInfoQueryWrapper() {
|
public LambdaQueryWrapper<UserInfo> getMiniUserInfoQueryWrapper() {
|
||||||
LambdaQueryWrapper<UserInfo> userInfoLambdaQueryWrapper = new LambdaQueryWrapper<>();
|
LambdaQueryWrapper<UserInfo> userInfoLambdaQueryWrapper = new LambdaQueryWrapper<>();
|
||||||
userInfoLambdaQueryWrapper.in(UserInfo::getUserRole, UserRoleEnum.USER, UserRoleEnum.MANAGER, UserRoleEnum.SUPERVISOR, UserRoleEnum.STAFF);
|
userInfoLambdaQueryWrapper.in(UserInfo::getUserRole, UserConstant.DEFAULT_ROLE, UserConstant.STAFF_ROLE, UserConstant.SUPERVISOR_ROLE, UserConstant.MANAGER_ROLE);
|
||||||
return userInfoLambdaQueryWrapper;
|
return userInfoLambdaQueryWrapper;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -533,16 +543,13 @@ public class UserInfoServiceImpl extends ServiceImpl<UserInfoMapper, UserInfo>
|
|||||||
/**
|
/**
|
||||||
* 批量更新父级用户团队人数
|
* 批量更新父级用户团队人数
|
||||||
*/
|
*/
|
||||||
private UserMainInfo updateParentUserInfoTeamCount(Long userId) {
|
private void updateParentUserInfoTeamCount(Long userId) {
|
||||||
UserMainInfo userMainInfo = new UserMainInfo();
|
|
||||||
userMainInfo.setUserId(userId);
|
|
||||||
List<Long> pathToRoot = this.findPathToRoot(userId);
|
List<Long> pathToRoot = this.findPathToRoot(userId);
|
||||||
List<UserMainInfo> userMainInfoList = commonService.findByFieldInTargetField(pathToRoot, userMainInfoService, id -> id, UserMainInfo::getUserId);
|
List<UserMainInfo> userMainInfoList = commonService.findByFieldInTargetField(pathToRoot, userMainInfoService, id -> id, UserMainInfo::getUserId);
|
||||||
for (UserMainInfo mainInfo : userMainInfoList) {
|
for (UserMainInfo mainInfo : userMainInfoList) {
|
||||||
mainInfo.setTeamSize(mainInfo.getTeamSize() + 1);
|
mainInfo.setTeamSize(mainInfo.getTeamSize() + 1);
|
||||||
}
|
}
|
||||||
userMainInfoService.updateBatchById(userMainInfoList);
|
userMainInfoService.updateBatchById(userMainInfoList);
|
||||||
return userMainInfo;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -39,6 +39,7 @@ import java.awt.*;
|
|||||||
import java.awt.image.BufferedImage;
|
import java.awt.image.BufferedImage;
|
||||||
import java.io.*;
|
import java.io.*;
|
||||||
import java.net.URL;
|
import java.net.URL;
|
||||||
|
import java.util.Arrays;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import java.util.concurrent.TimeUnit;
|
import java.util.concurrent.TimeUnit;
|
||||||
@ -120,7 +121,8 @@ public class WechatGetQrcodeServiceImpl implements WechatGetQrcodeService {
|
|||||||
param.put("page", "pages/loginModule/register/register");
|
param.put("page", "pages/loginModule/register/register");
|
||||||
param.put("scene", inviteCode + "=" + userRoleEnum.getValue());
|
param.put("scene", inviteCode + "=" + userRoleEnum.getValue());
|
||||||
param.put("width", 430);
|
param.put("width", 430);
|
||||||
param.put("env_version", "release");
|
param.put("check_path", false);
|
||||||
|
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)
|
||||||
|
107
src/main/resources/application-graduation.yml
Normal file
107
src/main/resources/application-graduation.yml
Normal file
@ -0,0 +1,107 @@
|
|||||||
|
spring:
|
||||||
|
datasource:
|
||||||
|
driver-class-name: com.mysql.cj.jdbc.Driver
|
||||||
|
url: jdbc:mysql://160.202.242.36:3306/qingcheng_graduation?serverTimezone=Asia/Shanghai
|
||||||
|
username: qingcheng
|
||||||
|
password: Qc@8ls2jf
|
||||||
|
hikari:
|
||||||
|
maximum-pool-size: 300
|
||||||
|
max-lifetime: 120000
|
||||||
|
|
||||||
|
|
||||||
|
rabbitmq:
|
||||||
|
host: 160.202.242.36
|
||||||
|
port: 5672
|
||||||
|
username: qingcheng
|
||||||
|
password: cksys6509
|
||||||
|
virtual-host: vhost-graduation
|
||||||
|
listener:
|
||||||
|
simple:
|
||||||
|
prefetch: 1
|
||||||
|
|
||||||
|
|
||||||
|
data:
|
||||||
|
redis:
|
||||||
|
port: 6379
|
||||||
|
host: 160.202.242.36
|
||||||
|
database: 6
|
||||||
|
password: Cksys6509
|
||||||
|
|
||||||
|
|
||||||
|
servlet:
|
||||||
|
multipart:
|
||||||
|
max-file-size: 20MB
|
||||||
|
max-request-size: 20MB
|
||||||
|
jackson:
|
||||||
|
date-format: yyyy-MM-dd HH:mm:ss
|
||||||
|
time-zone: GMT+8
|
||||||
|
|
||||||
|
|
||||||
|
# 文件上传和下载地址
|
||||||
|
file:
|
||||||
|
upload-dir: /www/wwwroot/fileUpload_qc/
|
||||||
|
# upload-dir: D:/qingcheng/image/
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
springdoc:
|
||||||
|
default-flat-param-object: true
|
||||||
|
|
||||||
|
#线程池配置
|
||||||
|
threadpool:
|
||||||
|
corePoolSize: 10
|
||||||
|
maxPoolSize: 50
|
||||||
|
queueCapacity: 1024
|
||||||
|
keepAliveTime: 60
|
||||||
|
|
||||||
|
|
||||||
|
server:
|
||||||
|
port: 9099
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
mybatis-plus:
|
||||||
|
mapper-locations: classpath:mapper/*.xml
|
||||||
|
configuration:
|
||||||
|
map-underscore-to-camel-case: false
|
||||||
|
# log-impl: org.apache.ibatis.logging.nologging.NoLoggingImpl
|
||||||
|
# log-impl: org.apache.ibatis.logging.stdout.StdOutImpl
|
||||||
|
global-config:
|
||||||
|
db-config:
|
||||||
|
logic-delete-field: isDelete #全局逻辑删除的实体字段名
|
||||||
|
logic-delete-value: 1 #逻辑已删除值(默认为1)
|
||||||
|
logic-not-delete-value: 0 #逻辑未删除值(默认为0)
|
||||||
|
type-handlers-package: com.cultural.heritage.handler
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
wx:
|
||||||
|
mini:
|
||||||
|
appId: wx8711c8d4fb04fef9
|
||||||
|
appSecret: 3ec1f19949d99f059e2ae4be62d02123
|
||||||
|
#
|
||||||
|
# pay:
|
||||||
|
# #应用id(小程序id)
|
||||||
|
# appId: wx61b63e27bddf4ea2
|
||||||
|
# #商户号
|
||||||
|
# merchantId: 1700326544
|
||||||
|
# #商户API私钥
|
||||||
|
# privateKeyPath: apiclient_key.pem
|
||||||
|
# #商户证书序列号
|
||||||
|
# merchantSerialNumber: 6DC8953AB741D309920DA650B92F837BE38A2757
|
||||||
|
# #商户APIv3密钥
|
||||||
|
# apiV3Key: fbemuj4Xql7CYlQJAoTEPYxvPSNgYT2t
|
||||||
|
# #通知地址
|
||||||
|
# notifyUrl: https://winning-mouse-internally.ngrok-free.app
|
||||||
|
# #微信服务器地址
|
||||||
|
# domain: https://api.mch.weixin.qq.com
|
||||||
|
# #商户APIv2密钥
|
||||||
|
# apiV2Key: cvsOH6TgbbdNUUqFJyLmWGaIEKoSqANg
|
||||||
|
# #商户API证书
|
||||||
|
# certificatePath: static/apiclient_cert.p12
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
knife4j:
|
||||||
|
enable: true
|
@ -1,4 +1,4 @@
|
|||||||
spring:
|
spring:
|
||||||
profiles:
|
profiles:
|
||||||
active: test
|
active: graduation
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user