完成微信支付以外的所有功能

This commit is contained in:
2025-08-08 09:41:08 +08:00
parent 62ce63249c
commit b2335d34a5
4 changed files with 43 additions and 38 deletions

View File

@ -141,7 +141,10 @@ public class CourseOrderController {
Long userId = courseOrder.getUserId(); Long userId = courseOrder.getUserId();
List<Long> pathToRoot = userInfoService.findPathToRoot(userId); List<Long> pathToRoot = userInfoService.findPathToRoot(userId);
List<Long> subPathToRoot = pathToRoot.subList(1, 3); List<Long> subPathToRoot = pathToRoot.subList(1, 3);
List<UserPerformanceSummary> userPerformanceSummaryList = commonService.findByFieldInTargetField(subPathToRoot, userPerformanceSummaryService, Function.identity(), UserPerformanceSummary::getUserId); List<UserPerformanceSummary> userPerformanceSummaryList = commonService.findByFieldInTargetFieldWithSpecificFields(
subPathToRoot, userPerformanceSummaryService, Function.identity(), UserPerformanceSummary::getUserId,
List.of(UserPerformanceSummary::getTotalAmount, UserPerformanceSummary::getNetAmount, UserPerformanceSummary::getOrderCount,
UserPerformanceSummary::getToRelease, UserPerformanceSummary::getToSettle));
BigDecimal rate; BigDecimal rate;
Map<String, BigDecimal> rateMap = userPerformanceSummaryService.queryRakeRewardsRate(); Map<String, BigDecimal> rateMap = userPerformanceSummaryService.queryRakeRewardsRate();
for (int i = 0; i < userPerformanceSummaryList.size(); i ++ ) { for (int i = 0; i < userPerformanceSummaryList.size(); i ++ ) {
@ -221,7 +224,9 @@ public class CourseOrderController {
Long userId = courseOrder.getUserId(); Long userId = courseOrder.getUserId();
List<Long> pathToRoot = userInfoService.findPathToRoot(userId); List<Long> pathToRoot = userInfoService.findPathToRoot(userId);
List<Long> superUserIdList = pathToRoot.subList(1, 3); List<Long> superUserIdList = pathToRoot.subList(1, 3);
List<UserPerformanceSummary> userPerformanceSummaryList = commonService.findByFieldInTargetField(superUserIdList, userPerformanceSummaryService, Function.identity(), UserPerformanceSummary::getUserId); List<UserPerformanceSummary> userPerformanceSummaryList = commonService.findByFieldInTargetFieldWithSpecificFields(
superUserIdList, userPerformanceSummaryService, Function.identity(), UserPerformanceSummary::getUserId,
List.of(UserPerformanceSummary::getTotalAmount, UserPerformanceSummary::getToRelease, UserPerformanceSummary::getRefunded));
BigDecimal rate; BigDecimal rate;
LambdaQueryWrapper<CoursePromotionCommissionPending> coursePromotionQueryWrapper = new LambdaQueryWrapper<>(); LambdaQueryWrapper<CoursePromotionCommissionPending> coursePromotionQueryWrapper = new LambdaQueryWrapper<>();
coursePromotionQueryWrapper.eq(CoursePromotionCommissionPending::getOrderId, courseOrder.getId()); coursePromotionQueryWrapper.eq(CoursePromotionCommissionPending::getOrderId, courseOrder.getId());

View File

@ -43,25 +43,25 @@ import java.math.BigDecimal;
import java.util.List; import java.util.List;
/** ///**
* 课程推广待提成记录 控制器 // * 课程推广待提成记录 控制器
*/ // */
@RestController //@RestController
@RequestMapping("coursePromo") //@RequestMapping("coursePromo")
@Slf4j //@Slf4j
@Tag(name = "课程推广待提成记录模块") //@Tag(name = "课程推广待提成记录模块")
@Transactional //@Transactional
public class CoursePromotionCommissionPendingController { //public class CoursePromotionCommissionPendingController {
//
@Resource // @Resource
private CoursePromotionCommissionPendingService coursePromotionCommissionPendingService; // private CoursePromotionCommissionPendingService coursePromotionCommissionPendingService;
//
@Resource // @Resource
private CommonService commonService; // private CommonService commonService;
//
@Resource // @Resource
private UserInfoService userInfoService; // private UserInfoService userInfoService;
//
@ -158,4 +158,4 @@ public class CoursePromotionCommissionPendingController {
// voPage.setTotal(page.getTotal()); // voPage.setTotal(page.getTotal());
// return ResultUtils.success(voPage); // return ResultUtils.success(voPage);
// } // }
} //}

View File

@ -79,8 +79,8 @@ public class AdvancementApplyController {
.or() .or()
.eq(AdvancementApply::getPhone, phone) .eq(AdvancementApply::getPhone, phone)
.and(w -> w.in(AdvancementApply::getReviewStatus, ReviewStatusEnum.APPROVED.getValue(), ReviewStatusEnum.PENDING.getValue())); .and(w -> w.in(AdvancementApply::getReviewStatus, ReviewStatusEnum.APPROVED.getValue(), ReviewStatusEnum.PENDING.getValue()));
List<AdvancementApply> applies = advancementApplyService.list(queryWrapper); long count = advancementApplyService.count(queryWrapper);
ThrowUtils.throwIf(!applies.isEmpty(), ErrorCode.OPERATION_ERROR, "当前手机号或身份证号已申请过"); ThrowUtils.throwIf(count > 0, ErrorCode.OPERATION_ERROR, "当前手机号或身份证号已申请过");
AdvancementApply advancementApply = commonService.copyProperties(advancementApplyAddRequest, AdvancementApply.class); AdvancementApply advancementApply = commonService.copyProperties(advancementApplyAddRequest, AdvancementApply.class);
advancementApplyService.save(advancementApply); advancementApplyService.save(advancementApply);
return ResultUtils.success(advancementApply.getId()); return ResultUtils.success(advancementApply.getId());

View File

@ -81,20 +81,20 @@ public class UserInfoController {
@PostMapping("test") // @PostMapping("test")
public BaseResponse<Boolean> test() throws IOException { // public BaseResponse<Boolean> test() throws IOException {
List<UserInfo> list = userInfoService.list(); // List<UserInfo> list = userInfoService.list();
List<UserMainInfo> userMainInfoList = userMainInfoService.list(); // List<UserMainInfo> userMainInfoList = userMainInfoService.list();
for (UserInfo userInfo : list) { // for (UserInfo userInfo : list) {
String userRole = userInfo.getUserRole(); // String userRole = userInfo.getUserRole();
UserRoleEnum userRoleEnum = UserRoleEnum.getEnumByValue(userRole); // UserRoleEnum userRoleEnum = UserRoleEnum.getEnumByValue(userRole);
String wxQrCode = wechatGetQrcodeService.getWxQrCode(userInfo.getInvitationCode(), userRoleEnum); // String wxQrCode = wechatGetQrcodeService.getWxQrCode(userInfo.getInvitationCode(), userRoleEnum);
UserMainInfo userMainInfo = UserMainInfo.builder().userId(userInfo.getId()).inviteQrCode(wxQrCode).build(); // UserMainInfo userMainInfo = UserMainInfo.builder().userId(userInfo.getId()).inviteQrCode(wxQrCode).build();
userMainInfoList.add(userMainInfo); // userMainInfoList.add(userMainInfo);
} // }
userMainInfoService.saveOrUpdateBatch(userMainInfoList); // userMainInfoService.saveOrUpdateBatch(userMainInfoList);
return ResultUtils.success(true); // return ResultUtils.success(true);
} // }