无关风月
2024-08-08 a322d2feafb95dfe6fa5bf1f3827e43b03e47e68
ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/service/impl/TGoodsServiceImpl.java
@@ -11,6 +11,7 @@
import org.springframework.stereotype.Service;
import org.springframework.util.StringUtils;
import java.util.ArrayList;
import java.util.List;
/**
@@ -39,11 +40,17 @@
            // 去除最后一个字符
            stringBuilder.deleteCharAt(stringBuilder.length()-1);
        }
        if (list.isEmpty()) {
            pageInfo.setRecords(list);
            return pageInfo;
        }
        String string = stringBuilder.toString();
        List<Integer> data = orderClient.getSalesCountByGoodsId(string).getData();
        String res = string+"-"+dto.getType();
//        goodsClient
        // 远程调用cha'xun
        List<Integer> data = orderClient.getSalesCountByGoodsId(res).getData();
        for (int i = 0; i < list.size(); i++) {
            list.get(i).setSalesCount(data.get(i));
        }
        pageInfo.setRecords(list);
        return pageInfo;
    }