Pu Zhibing
2024-10-12 be22cb2494544c850fcc52039d3327e36610b19d
ruoyi-service/ruoyi-order/src/main/java/com/ruoyi/order/service/impl/TOrderEvaluateServiceImpl.java
@@ -115,17 +115,23 @@
    @Override
    public List<TEvaluationTagVO> getTagCount() {
        // 查询标签列表
        R<List<TEvaluationTagVO>> r = evaluationTagClient.getTagList(null);
        R<List<TEvaluationTagVO>> r = evaluationTagClient.getList();
        List<TEvaluationTagVO> tagList = r.getData();
        List<Integer> tagIds = tagList.stream().map(TEvaluationTagVO::getId).collect(Collectors.toList());
        // 统计标签使用数量
        List<TEvaluationTagVO> counts = orderEvaluateTagMapper.getCountByTagIds(tagIds);
        List<Integer> ids = counts.stream().map(TEvaluationTagVO::getId).collect(Collectors.toList());
        tagList.forEach(tag -> {
            counts.forEach(count -> {
                if (tag.getId().equals(count.getId())) {
                    tag.setTagCount(count.getTagCount());
                }
            });
            if(ids.contains(tag.getId())){
                counts.forEach(count -> {
                    if (tag.getId().equals(count.getId())) {
                        tag.setTagCount(count.getTagCount());
                    }
                });
            }else{
                tag.setTagCount(0);
            }
        });
        tagList = tagList.stream().sorted(Comparator.comparing(TEvaluationTagVO::getTagCount).reversed()).collect(Collectors.toList());
        // 统计有图,好评,中差评数量
@@ -221,9 +227,11 @@
        List<GetOrderEvaluatePageListDTO> list = this.baseMapper.getPageList(pageList, evaluationTagIds, pageInfo);
        for (GetOrderEvaluatePageListDTO dto : list) {
            TAppUser appUser = appUserClient.getUserById(dto.getAppUserId()).getData();
            dto.setAvatar(appUser.getAvatar());
            String phone = appUser.getPhone();
            dto.setPhone(phone.substring(0, 3) + "****" + phone.substring(6));
            if(null != appUser){
                dto.setAvatar(appUser.getAvatar());
                String phone = appUser.getPhone();
                dto.setPhone(phone.substring(0, 3) + "****" + phone.substring(6));
            }
            Site site = siteClient.getSiteByIds(Arrays.asList(dto.getSiteId())).getData().get(0);
            dto.setSiteName(site.getName());
            List<TOrderEvaluateTag> tOrderEvaluateTags = orderEvaluateTagMapper.selectList(new LambdaQueryWrapper<TOrderEvaluateTag>().eq(TOrderEvaluateTag::getOrderEvaluateId, dto.getId()));
@@ -278,7 +286,7 @@
            if(null != num1 && 0 < num1){
                TAppUser appUser = appUserClient.getUserById(userid).getData();
                if(null != appUser.getVipId()){
                    TVip vip = vipClient.getInfo(appUser.getVipId()).getData();
                    TVip vip = vipClient.getInfo1(appUser.getVipId()).getData();
                    Integer doubleIntegration = vip.getDoubleIntegration();
                    //双倍积分
                    if(1 == doubleIntegration){
@@ -296,6 +304,7 @@
                appUserIntegralChange.setHistoricalIntegral(points);
                appUserIntegralChange.setCurrentIntegral(points + num1);
                appUserIntegralChange.setCreateTime(LocalDateTime.now());
                appUserIntegralChange.setOrderCode(orderEvaluate.getId().toString());
                appUserIntegralChangeClient.addAppUserIntegralChange(appUserIntegralChange);
            }
        }