| | |
| | | import com.stylefeng.guns.modular.system.warpper.BaseWarpper; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.util.CollectionUtils; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | import java.util.stream.Collectors; |
| | | |
| | | @Service |
| | | public class DriverServiceImpl extends ServiceImpl<DriverMapper, Driver> implements IDriverService { |
| | |
| | | |
| | | return list; |
| | | } |
| | | @Override |
| | | public List<Driver> queryIdleDriverAllCall(Integer type, Double lon, Double lat, Double distance, List<Integer> companyIds) throws Exception { |
| | | if(CollectionUtils.isEmpty(companyIds)){ |
| | | System.err.println("-----未查询到该区域分公司进行推单------"); |
| | | return new ArrayList<>(); |
| | | } |
| | | companyIds = companyIds.stream().distinct().collect(Collectors.toList()); |
| | | List<Driver> allDrivers = new ArrayList<>(); |
| | | for (Integer companyId : companyIds) { |
| | | List<Driver> drivers = driverMapper.queryIdleDriver(type, companyId); |
| | | allDrivers.addAll(drivers); |
| | | } |
| | | System.err.println("-----符合条件的司机"+allDrivers); |
| | | return allDrivers; |
| | | } |
| | | |
| | | |
| | | /** |