| | |
| | | import com.dsh.account.feignclient.activity.UserConponClient; |
| | | import com.dsh.account.feignclient.activity.model.*; |
| | | import com.dsh.account.feignclient.competition.DeductionCompetitionsClient; |
| | | import com.dsh.account.feignclient.competition.model.BillingDataRequestVo; |
| | | import com.dsh.account.feignclient.competition.model.PaymentCompetition; |
| | | import com.dsh.account.feignclient.course.CoursePackageClient; |
| | | import com.dsh.account.feignclient.course.CoursePackageConfigClient; |
| | | import com.dsh.account.feignclient.course.CoursePaymentClient; |
| | | import com.dsh.account.feignclient.course.VideoOfCourseListClient; |
| | | import com.dsh.account.feignclient.course.model.*; |
| | | import com.dsh.account.feignclient.other.ImgConfigClient; |
| | | import com.dsh.account.feignclient.other.RechargeConfigClient; |
| | |
| | | @Resource |
| | | private ImgConfigClient icfgClient; |
| | | |
| | | |
| | | @Resource |
| | | private VideoOfCourseListClient voclClient; |
| | | |
| | | @Resource |
| | | private VipPaymentMapper vipPaymentMapper; |
| | | |
| | |
| | | |
| | | List<RegisteredCourse> courseList = new ArrayList<>(); |
| | | List<StuCourseResp> stuCoursePayment = paymentClient.getStuCoursePayment(tStudent.getId()); |
| | | List<Integer> coursePackIds = new ArrayList<>(); |
| | | if (stuCoursePayment.size() > 0){ |
| | | coursePackIds = stuCoursePayment.stream().map(StuCourseResp::getCourseId).collect(Collectors.toList()); |
| | | for (StuCourseResp tCoursePackagePayment : stuCoursePayment) { |
| | | RegisteredCourse course = new RegisteredCourse(); |
| | | course.setCourseId(tCoursePackagePayment.getCourseId()); |
| | |
| | | } |
| | | } |
| | | classInfoVo.setCourseList(courseList); |
| | | |
| | | List<ExerciseVideo> videos = new ArrayList<>(); |
| | | |
| | | classInfoVo.setExerciseVideoList(videos); |
| | | List<ExerciseVideo> stuCourseOfVideoList = voclClient.getStuCourseOfVideoList(coursePackIds); |
| | | System.out.println(stuCourseOfVideoList); |
| | | classInfoVo.setExerciseVideoList(stuCourseOfVideoList); |
| | | }else { |
| | | classInfoVo.setIsThere(2); |
| | | List<TImgConfig> tImgConfigs = configClient.getNoneStuImgs(); |
| | |
| | | CourseVenue courseVenue = new CourseVenue(); |
| | | courseVenue.setStoreId(storeId); |
| | | courseVenue.setAreaName(value.get(0).getCourseName()); |
| | | courseVenue.setSiteDistance(LonlatUtils.distance(Double.parseDouble(longitude), Double.parseDouble(latitude), |
| | | Double.parseDouble(value.get(0).getLon()), Double.parseDouble(value.get(0).getLat())) + ""); |
| | | |
| | | if (ToolUtil.isEmpty(longitude) && ToolUtil.isEmpty(latitude)){ |
| | | courseVenue.setSiteDistance(0+""); |
| | | }else { |
| | | courseVenue.setSiteDistance(LonlatUtils.distance(Double.parseDouble(longitude), Double.parseDouble(latitude), |
| | | Double.parseDouble(value.get(0).getLon()), Double.parseDouble(value.get(0).getLat())) + ""); |
| | | } |
| | | List<CourseVenue.CouList> courses = new ArrayList<>(); |
| | | for (CourseOfStoreVo courseOfStoreVo : value) { |
| | | CourseVenue.CouList couList = new CourseVenue.CouList(); |
| | |
| | | TAppUser appUser = this.getById(appUserId); |
| | | benefirVo.setUserHeadImg(appUser.getHeadImg()); |
| | | benefirVo.setUserName(appUser.getName()); |
| | | benefirVo.setWpCoin(ToolUtil.isEmpty(appUser.getPlayPaiCoins()) ? 0 : appUser.getPlayPaiCoins()); |
| | | benefirVo.setUserIntegral(ToolUtil.isEmpty(appUser.getIntegral()) ? 0 : appUser.getIntegral()); |
| | | if (appUser.getIsVip() == 1){ |
| | | benefirVo.setIsMember("年度会员"); |
| | | }else { |
| | | benefirVo.setIsMember("普通用户"); |
| | | } |
| | | benefirVo.setCommodities(mcClient.getConvertibleGoods()); |
| | | List<IntegralCommodity> convertibleGoods = mcClient.getConvertibleGoods(); |
| | | benefirVo.setCommodities(convertibleGoods); |
| | | benefirVo.setImage(icfgClient.getImageConfig()); |
| | | return benefirVo; |
| | | } |
| | |
| | | monthStart = DateTimeHelper.getCurrentMouthStart(); |
| | | monthEnd = DateTimeHelper.getCurrentMouthEnd(); |
| | | } |
| | | |
| | | BillingDataRequestVo requestVo = new BillingDataRequestVo(); |
| | | requestVo.setMonthStart(monthStart); |
| | | requestVo.setMonthEnd(monthEnd); |
| | | requestVo.setAppUserId(appUserId); |
| | | // 1.赛事报名 |
| | | List<PaymentCompetition> allCompetitionPayRecord = deducClient.getAllCompetitionPayRecord(appUserId); |
| | | List<PaymentCompetition> allCompetitionPayRecord = deducClient.getAllCompetitionPayRecord(requestVo); |
| | | if (allCompetitionPayRecord.size() > 0 ){ |
| | | for (PaymentCompetition paymentCompetition : allCompetitionPayRecord) { |
| | | ConsumeDetail consumeDetail = new ConsumeDetail(); |
| | |
| | | consumeDetail.setConsumeTime(simpleDateFormat.format(paymentCompetition.getInsertTime())); |
| | | consumeDetail.setConsumeAmount("-" + paymentCompetition.getAmount()); |
| | | details.add(consumeDetail); |
| | | consumeDetail.setType(1); |
| | | } |
| | | } |
| | | // 2.取消赛事报名 |
| | | List<PaymentCompetition> cancelOrderOfUserPayRecord = deducClient.getCancelOrderOfUserPayRecord(appUserId); |
| | | List<PaymentCompetition> cancelOrderOfUserPayRecord = deducClient.getCancelOrderOfUserPayRecord(requestVo); |
| | | if (cancelOrderOfUserPayRecord.size() > 0 ){ |
| | | for (PaymentCompetition paymentCompetition : cancelOrderOfUserPayRecord) { |
| | | ConsumeDetail consumeDetail = new ConsumeDetail(); |
| | | consumeDetail.setConsumeName(RechargeRecordEnum.CANCEL_EVENT_REGISTRATION.getMsg()); |
| | | consumeDetail.setConsumeTime(simpleDateFormat.format(paymentCompetition.getInsertTime())); |
| | | consumeDetail.setConsumeAmount("+" + paymentCompetition.getAmount()); |
| | | consumeDetail.setType(1); |
| | | details.add(consumeDetail); |
| | | } |
| | | } |
| | | // 3.课包购买 |
| | | List<TCoursePackagePayment> amountPayRecord = paymentClient.getAmountPayRecord(appUserId); |
| | | List<TCoursePackagePayment> amountPayRecord = paymentClient.getAmountPayRecord(requestVo); |
| | | if (amountPayRecord.size() > 0 ){ |
| | | for (TCoursePackagePayment coursePackagePayment : amountPayRecord) { |
| | | ConsumeDetail consumeDetail = new ConsumeDetail(); |
| | | consumeDetail.setConsumeName(RechargeRecordEnum.COURSE_PACKAGE_PURCHASE.getMsg()); |
| | | consumeDetail.setConsumeTime(simpleDateFormat.format(coursePackagePayment.getInsertTime())); |
| | | consumeDetail.setConsumeAmount("-" + coursePackagePayment.getCashPayment()); |
| | | consumeDetail.setType(2); |
| | | details.add(consumeDetail); |
| | | } |
| | | } |
| | | // 4.场地预约 |
| | | List<SiteBooking> allSiteBookingList = stClient.getAllSiteBookingList(appUserId); |
| | | List<SiteBooking> allSiteBookingList = stClient.getAllSiteBookingList(requestVo); |
| | | if (allSiteBookingList.size() > 0){ |
| | | for (SiteBooking booking : allSiteBookingList) { |
| | | ConsumeDetail consumeDetail = new ConsumeDetail(); |
| | |
| | | consumeDetail.setConsumeName(RechargeRecordEnum.VENUE_RESERVATION.getMsg()); |
| | | consumeDetail.setConsumeAmount("-" + booking.getPayMoney()); |
| | | consumeDetail.setConsumeTime(simpleDateFormat.format(booking.getPayTime())); |
| | | consumeDetail.setType(2); |
| | | }else { |
| | | consumeDetail.setConsumeName(RechargeRecordEnum.CANCEL_VENUE_RESERVATION.getMsg()); |
| | | consumeDetail.setConsumeAmount("+" + booking.getPayMoney()); |
| | | consumeDetail.setConsumeTime(simpleDateFormat.format(booking.getCancelTime())); |
| | | consumeDetail.setType(1); |
| | | } |
| | | details.add(consumeDetail); |
| | | } |
| | |
| | | consumeDetail.setConsumeName(RechargeRecordEnum.ANNUAL_MEMBERSHIP.getMsg()); |
| | | consumeDetail.setConsumeTime(simpleDateFormat.format(vipPayment.getInsertTime())); |
| | | consumeDetail.setConsumeAmount("-" + vipPayment.getAmount()); |
| | | consumeDetail.setType(2); |
| | | details.add(consumeDetail); |
| | | } |
| | | } |
| | |
| | | consumeDetail.setConsumeName(RechargeRecordEnum.RECHARGE.getMsg() + ":" + rechargeRecord.getPlayPaiCoins()); |
| | | consumeDetail.setConsumeTime(simpleDateFormat.format(rechargeRecord.getInsertTime())); |
| | | consumeDetail.setConsumeAmount("-" + rechargeRecord.getAmount()); |
| | | consumeDetail.setType(2); |
| | | details.add(consumeDetail); |
| | | } |
| | | } |
| | |
| | | return date2.compareTo(date1); |
| | | } |
| | | }); |
| | | |
| | | if (ToolUtil.isNotEmpty(recordId)){ |
| | | details = details.stream() |
| | | .filter(response -> Objects.equals(response.getType(), recordId)) |
| | | .collect(Collectors.toList()); |
| | | } |
| | | } |
| | | return details; |
| | | } |
| | |
| | | List<RechargeCentVo> centVos = new ArrayList<>(); |
| | | TAppUser tAppUser = this.baseMapper.selectById(appUserId); |
| | | List<Map<String, Object>> rechargeConfig = reconMapper.getRechargeConfig(); |
| | | System.out.println(rechargeConfig); |
| | | if (rechargeConfig.size() > 0 ){ |
| | | for (Map<String, Object> stringObjectMap : rechargeConfig) { |
| | | RechargeCentVo vo = new RechargeCentVo(); |
| | | vo.setChargeId((Integer) stringObjectMap.get("money")); |
| | | vo.setAmount(""+stringObjectMap.get("money")); |
| | | Double money = (Double) stringObjectMap.get("money"); |
| | | vo.setAmount(BigDecimal.valueOf(money) ); |
| | | if (tAppUser.getIsVip() == 1){ |
| | | vo.setWpGold(stringObjectMap.get("MemberCoins")+""); |
| | | vo.setWpGold((Integer) stringObjectMap.get("MemberCoins")); |
| | | }else { |
| | | vo.setWpGold(stringObjectMap.get("usersCoins")+""); |
| | | vo.setWpGold((Integer) stringObjectMap.get("usersCoins")); |
| | | } |
| | | centVos.add(vo); |
| | | } |
| | |
| | | } |
| | | } |
| | | if (StringUtils.hasText(request.getSearch())){ |
| | | goods = goods.stream() |
| | | .filter(merchandise -> merchandise.getGoodName().contains(request.getSearch())) |
| | | .collect(Collectors.toList()); |
| | | if (goods.size() > 0 ){ |
| | | goods = goods.stream() |
| | | .filter(merchandise -> merchandise.getGoodName().contains(request.getSearch())) |
| | | .collect(Collectors.toList()); |
| | | } |
| | | } |
| | | if (null != request.getRank()){ |
| | | switch (request.getRank()){ |
| | | case 1: |
| | | goods = goods.stream() |
| | | .sorted(Comparator.comparing(Goods::getIntegral).reversed()) |
| | | .collect(Collectors.toList()); |
| | | if (goods.size() > 0 ){ |
| | | goods = goods.stream() |
| | | .sorted(Comparator.comparing(Goods::getIntegral).reversed()) |
| | | .collect(Collectors.toList()); |
| | | } |
| | | break; |
| | | case 2: |
| | | goods = goods.stream() |
| | | .sorted(Comparator.comparing(Goods::getIntegral)) |
| | | .collect(Collectors.toList()); |
| | | if (goods.size() > 0 ){ |
| | | goods = goods.stream() |
| | | .sorted(Comparator.comparing(Goods::getIntegral)) |
| | | .collect(Collectors.toList()); |
| | | } |
| | | break; |
| | | case 3: |
| | | goods = goods.stream() |
| | | .sorted(Comparator.comparing(Goods::getNums).reversed()) |
| | | .collect(Collectors.toList()); |
| | | if (goods.size() > 0 ){ |
| | | goods = goods.stream() |
| | | .sorted(Comparator.comparing(Goods::getNums).reversed()) |
| | | .collect(Collectors.toList()); |
| | | } |
| | | break; |
| | | default: |
| | | break; |
| | |
| | | |
| | | } |
| | | if (null != request.getGoodsType()){ |
| | | goods = goods.stream() |
| | | .filter(merchandise -> merchandise.getGoodsType().equals(request.getGoodsType())) |
| | | .collect(Collectors.toList()); |
| | | if (goods.size() > 0 ){ |
| | | goods = goods.stream() |
| | | .filter(merchandise -> merchandise.getGoodsType().equals(request.getGoodsType())) |
| | | .collect(Collectors.toList()); |
| | | } |
| | | } |
| | | Pageable pageable = PageRequest.of(request.getPageNum() - 1, request.getPageSize()); |
| | | Page<Goods> page = getPage(goods, pageable); |
| | |
| | | weeksOfCourseRest.setStuId(stuId); |
| | | weeksOfCourseRest.setAppUserId(appUserId); |
| | | List<CourseOfStoreVo> storeOfCourses = paymentClient.getStoreOfCourses(weeksOfCourseRest); |
| | | System.out.println(storeOfCourses); |
| | | if (storeOfCourses.size() > 0 ){ |
| | | courseVenues = dealDatas(storeOfCourses,longitude,latitude); |
| | | } |