liujie
2023-08-07 f5ca8f01cf6b8256a25e8c6838d805fe3fca43fc
cloud-server-account/src/main/java/com/dsh/account/service/impl/TAppUserServiceImpl.java
@@ -175,7 +175,9 @@
                    }
                }
                classInfoVo.setCourseList(courseList);
                classInfoVo.setExerciseVideoList(voclClient.getStuCourseOfVideoList(coursePackIds));
                List<ExerciseVideo> stuCourseOfVideoList = voclClient.getStuCourseOfVideoList(coursePackIds);
                System.out.println(stuCourseOfVideoList);
                classInfoVo.setExerciseVideoList(stuCourseOfVideoList);
            }else {
                classInfoVo.setIsThere(2);
                List<TImgConfig> tImgConfigs = configClient.getNoneStuImgs();
@@ -486,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 {
@@ -644,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);
            }
@@ -745,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;
@@ -772,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);