cloud-server-account/src/main/java/com/dsh/account/service/impl/VipPaymentServiceImpl.java
@@ -122,6 +122,8 @@ appUser.setIsVip(1); appUser.setVipEndTime(calendar.getTime()); appUserService.updateById(appUser); // 注册会员送券 先判断是否有注册送券类型的优惠券 判断优惠券状态 审核是否通过 是否删除 是否在有效期内 是否领取数量达上限 userConponClient.queryCouponByUser(appUser.getId()); return; } if("USERPAYING".equals(trade_state) || "ACCEPT".equals(trade_state)){ @@ -205,6 +207,8 @@ calendar.set(Calendar.YEAR, calendar.get(Calendar.YEAR) + 1); appUser.setVipEndTime(calendar.getTime()); appUserService.updateById(appUser); // 注册会员送券 先判断是否有注册送券类型的优惠券 判断优惠券状态 审核是否通过 是否删除 是否在有效期内 是否领取数量达上限 userConponClient.queryCouponByUser(appUser.getId()); return; } if("WAIT_BUYER_PAY".equals(tradeStatus)){ @@ -260,8 +264,7 @@ calendar.set(Calendar.YEAR, calendar.get(Calendar.YEAR) + 1); appUser.setVipEndTime(calendar.getTime()); appUserService.updateById(appUser); // 注册会员送券 先判断是否有注册送券类型的优惠券 判断优惠券状态 审核是否通过 是否删除 是否在有效期内 是否领取数量达上限 userConponClient.queryCouponByUser(appUser.getId()); return ResultUtil.success(); } cloud-server-competition/src/main/java/com/dsh/competition/controller/CompetitionController.java
@@ -95,10 +95,13 @@ // 获取到赛事id集合 去重 List<Integer> collect = comIds.stream().distinct().collect(Collectors.toList()); // 根据赛事id 查询赛事支付记录 获取用户ids List<Integer> competitionId = paymentCompetitionService.list(new QueryWrapper<PaymentCompetition>() .in("competitionId", collect)) .stream().map(PaymentCompetition::getAppUserId).collect(Collectors.toList()); return competitionId; List<PaymentCompetition> competitionId = paymentCompetitionService.list(new QueryWrapper<PaymentCompetition>() .in("competitionId", collect)); // .stream().map(PaymentCompetition::getAppUserId).collect(Collectors.toList()); return null; } /** * 获取赛事报名记录 cloud-server-course/src/main/java/com/dsh/course/controller/CoursePackageController.java
@@ -33,6 +33,7 @@ import java.util.Comparator; import java.util.List; import java.util.Map; import java.util.stream.Collectors; /** * @author zhibing.pu @@ -62,6 +63,29 @@ @Autowired private TokenUtil tokenUtil; /** * 根据门店ids获取课包ids 根据课包ids 获取购课记录的用户ids */ @ResponseBody @PostMapping("/base/coursePackage/getCoursePackageByStoreIds") public List<Integer> getCoursePackageByStoreIds(@RequestBody List<Integer> storeIds){ try { // 获取当前课包的ids List<Integer> courseIds = coursePackageService.list(new QueryWrapper<TCoursePackage>().in("storeId", storeIds)) .stream().map(TCoursePackage::getId).collect(Collectors.toList()); List<Integer> userIds = tcppmenService.list(new QueryWrapper<TCoursePackagePayment>().in("coursePackageId", courseIds)) .stream().map(TCoursePackagePayment::getAppUserId).collect(Collectors.toList()); return userIds; }catch (Exception e){ e.printStackTrace(); return null; } } /** * 根据id获取课包 * @param id cloud-server-management/src/main/java/com/dsh/course/feignClient/course/CoursePackageClient.java
@@ -25,7 +25,11 @@ @FeignClient("mb-cloud-course") public interface CoursePackageClient { /** * 根据门店ids获取课包ids 根据课包ids 获取购课记录的用户ids */ @PostMapping("/base/coursePackage/getCoursePackageByStoreIds") List<Integer> getCoursePackageByStoreIds(@RequestBody List<Integer> storeIds); /** * 根据课包类型获取课包 */ cloud-server-management/src/main/java/com/dsh/course/feignClient/other/BallClient.java
@@ -8,10 +8,7 @@ import com.dsh.guns.modular.system.model.dto.BookingQuery; import io.swagger.models.auth.In; import org.springframework.cloud.openfeign.FeignClient; 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.RequestParam; import org.springframework.web.bind.annotation.*; import java.util.ArrayList; import java.util.List; @@ -19,7 +16,9 @@ @FeignClient(value = "mb-cloud-other") public interface BallClient { // 根据门店ids 获取游戏记录 @PostMapping("/game/getGameByStoreIds") List<Integer> getGameByStoreIds(@RequestBody List<Integer> storeIds); @PostMapping("/student/webStudentList") List<Game> list(@RequestBody BallQueryDto ballQueryDto); @PostMapping("/save") cloud-server-management/src/main/java/com/dsh/guns/modular/system/controller/code/TAppUserController.java
@@ -17,6 +17,7 @@ import com.dsh.course.feignClient.competition.model.Competition; import com.dsh.course.feignClient.competition.model.ListQuery; import com.dsh.course.feignClient.course.CoursePackageClient; import com.dsh.course.feignClient.other.BallClient; import com.dsh.course.feignClient.other.StoreClient; import com.dsh.course.feignClient.other.model.SiteChangeStateVO; import com.dsh.guns.config.UserExt; @@ -72,6 +73,9 @@ private ISiteBookingService siteBookingService; @Autowired private CoursePackageClient coursePackageClient; @Autowired private BallClient ballClient; /** * 跳转体测预约管理首页 */ @@ -202,19 +206,30 @@ listQuery.setIds(storeIds); // 通过门店ids 获取赛事的支付记录 获取到用户的ids List<Integer> list = competitionClient.getUserIds(listQuery); // todo 写根据用户ids查询用户的方法 // 获取场地预约记录 拿到用户ids List<Integer> storeId = siteBookingService.list(new QueryWrapper<SiteBooking>().in("storeId", storeIds)) List<Integer> siteUsers = siteBookingService.list(new QueryWrapper<SiteBooking>().in("storeId", storeIds)) .stream().map(SiteBooking::getAppUserId).collect(Collectors.toList()); // 获取课程购买记录 // 获取游戏记录 // 获取课程购买记录 拿到用户ids List<Integer> cpUsers = coursePackageClient.getCoursePackageByStoreIds(storeIds); // 获取游戏记录 拿到用户ids List<Integer> gameUsers = ballClient.getGameByStoreIds(storeIds); // 用户ids List<Integer> users = new ArrayList<>(); users.addAll(list); users.addAll(siteUsers); users.addAll(cpUsers); users.addAll(gameUsers); // 去重后的用户id List<Integer> collect = users.stream().distinct().collect(Collectors.toList()); List<QueryAppUserVO> queryAppUserVOS1 = new ArrayList<>(); for (QueryAppUserVO queryAppUserVO : queryAppUserVOS) { if (collect.contains(queryAppUserVO.getId())){ queryAppUserVOS1.add(queryAppUserVO); } } queryAppUserVOS = queryAppUserVOS1; } for (QueryAppUserVO queryAppUserVO : queryAppUserVOS) { if (queryAppUserVO.getSalesmanUserId()!=null){ cloud-server-other/src/main/java/com/dsh/other/controller/BallController.java
@@ -5,10 +5,7 @@ import com.dsh.other.feignclient.model.AdvertisementChangeStateDTO; import com.dsh.other.feignclient.model.AdvertisementQuery; import com.dsh.other.model.BannerVo; import com.dsh.other.service.GameService; import com.dsh.other.service.IBannerService; import com.dsh.other.service.IRegionService; import com.dsh.other.service.TGameConfigService; import com.dsh.other.service.*; import com.dsh.other.util.ResultUtil; import io.swagger.annotations.ApiImplicitParam; import io.swagger.annotations.ApiImplicitParams; @@ -22,6 +19,7 @@ import java.util.Date; import java.util.List; import java.util.Map; import java.util.stream.Collectors; /** * @author zhibing.pu @@ -32,6 +30,8 @@ public class BallController { @Autowired private GameService gameService; @Autowired private TGameRecordService gameRecordService; @ResponseBody @PostMapping("/student/webStudentList") @@ -39,6 +39,18 @@ List<Game> games = gameService.queryAll(ballQueryDto); return games; } // 根据门店ids 获取游戏记录 @ResponseBody @PostMapping("/game/getGameByStoreIds") public List<Integer> getGameByStoreIds(@RequestBody List<Integer> storeIds){ // 游戏id List<Integer> gamesId = gameService.list(new QueryWrapper<Game>().in("storeId", storeIds)) .stream().map(Game::getId).collect(Collectors.toList()); // 根据游戏id获取游戏记录 获取用户Ids List<Integer> userId = gameRecordService.list(new QueryWrapper<TGameRecord>().in("gameId", gamesId)) .stream().map(TGameRecord::getUserId).collect(Collectors.toList()); return userId; } @Autowired private IRegionService regionService;