liujie
2023-08-07 f5ca8f01cf6b8256a25e8c6838d805fe3fca43fc
cloud-server-account/src/main/java/com/dsh/account/service/impl/TAppUserServiceImpl.java
@@ -175,18 +175,8 @@
                    }
                }
                classInfoVo.setCourseList(courseList);
                List<ExerciseVideo> stuCourseOfVideoList = new ArrayList<>();
                ExerciseVideo video = new ExerciseVideo();
                video.setVideoUrl("https://media.w3.org/2010/05/sintel/trailer.mp4");
                video.setVideoCoverImgUrl("https://img1.baidu.com/it/u=1614146743,3691458181&fm=253&fmt=auto&app=120&f=JPEG?w=605&h=383");
                video.setVideoName("课后练习足球课");
                stuCourseOfVideoList.add(video);
                ExerciseVideo exerciseVideo = new ExerciseVideo();
                exerciseVideo.setVideoUrl("https://media.w3.org/2010/05/sintel/trailer.mp4");
                exerciseVideo.setVideoCoverImgUrl("https://img0.baidu.com/it/u=1492570361,4260963468&fm=253&fmt=auto&app=138&f=JPEG?w=750&h=500");
                exerciseVideo.setVideoName("篮球课");
                stuCourseOfVideoList.add(exerciseVideo);
                List<ExerciseVideo> stuCourseOfVideoList = voclClient.getStuCourseOfVideoList(coursePackIds);
                System.out.println(stuCourseOfVideoList);
                classInfoVo.setExerciseVideoList(stuCourseOfVideoList);
            }else {
                classInfoVo.setIsThere(2);
@@ -498,6 +488,8 @@
        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 {
@@ -656,15 +648,16 @@
        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);
            }
@@ -757,26 +750,34 @@
            }
        }
        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;
@@ -784,9 +785,11 @@
        }
        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);