puzhibing
2023-06-02 fb4902cf37252a3e47a7b7f49542b3b627f5b2d9
user/guns-admin/src/main/java/com/agentdriving/user/modular/system/service/impl/DriverServiceImpl.java
@@ -64,8 +64,9 @@
        // 构造query对象
        Query query = Query.query(Criteria.where("location").withinSphere(circle));
        List<Location> locations = mongoTemplate.find(query, Location.class);
//        System.err.println("附近空闲司机" + JSON.toJSONString(locations));
        List<Integer> collect = locations.stream().map(Location::getDriverId).collect(Collectors.toList());
        List<Driver> drivers = this.selectList(new EntityWrapper<Driver>().in("id", collect).eq("approvalStatus", 2).eq("serverStatus", 1).eq("status", 1));
        collect = drivers.stream().map(Driver::getId).collect(Collectors.toList());
        List<DriverWork> driverWorks = driverWorkService.selectList(new EntityWrapper<DriverWork>().in("driverId", collect).eq("status", 1));
        for (DriverWork driverWork : driverWorks) {
            String value = redisUtil.getValue("DRIVER" + driverWork.getDriverId());