无关风月
2025-01-11 ec73339e08669dc5a0d4ff93e6640f51473c08cd
ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/service/impl/SeckillActivityInfoServiceImpl.java
@@ -106,16 +106,18 @@
            shops = shopMapper.selectList(new LambdaUpdateWrapper<Shop>().eq(Shop::getDelFlag, 0));
        }
        for (Shop shop : shops) {
            Double wgs84 = GeodesyUtil.getDistance(longitude + "," + latitude, shop.getLongitude() + "," + shop.getLatitude()).get("WGS84");
            shop.setDistance(wgs84);
        }
        shops.sort(new Comparator<Shop>() {
            @Override
            public int compare(Shop o1, Shop o2) {
                return o1.getDistance().compareTo(o2.getDistance());
        if(StringUtils.isNotEmpty(longitude) && StringUtils.isNotEmpty(latitude)){
            for (Shop shop : shops) {
                Double wgs84 = GeodesyUtil.getDistance(longitude + "," + latitude, shop.getLongitude() + "," + shop.getLatitude()).get("WGS84");
                shop.setDistance(wgs84);
            }
        });
            shops.sort(new Comparator<Shop>() {
                @Override
                public int compare(Shop o1, Shop o2) {
                    return o1.getDistance().compareTo(o2.getDistance());
                }
            });
        }
        seckillActivityDetailVO.setShopList(shops);
        Integer integer = orderClient.getGoodsSaleNum(goods.getId(), 2).getData();
        seckillActivityDetailVO.setSaleNum(integer);