| | |
| | | package com.stylefeng.guns.modular.system.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.mapper.EntityWrapper; |
| | | import com.baomidou.mybatisplus.service.impl.ServiceImpl; |
| | | import com.stylefeng.guns.modular.system.dao.CarModelMapper; |
| | | import com.stylefeng.guns.modular.system.dao.DriverMapper; |
| | |
| | | import com.stylefeng.guns.modular.system.service.*; |
| | | import com.stylefeng.guns.modular.system.util.DateUtil; |
| | | import com.stylefeng.guns.modular.system.util.ResultUtil; |
| | | import com.stylefeng.guns.modular.system.warpper.BaseWarpper; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | |
| | | |
| | | @Autowired |
| | | private IDispatchService dispatchService; |
| | | |
| | | @Autowired |
| | | private IDriverServiceService driverServiceService; |
| | | |
| | | @Autowired |
| | | private IDriverWorkService driverWorkService; |
| | | |
| | | @Autowired |
| | | private ICarService carService; |
| | | |
| | | @Autowired |
| | | private ICarServiceService carServiceService; |
| | | |
| | | |
| | | |
| | |
| | | @Override |
| | | public List<Driver> queryByCarId(Integer carId) throws Exception { |
| | | return driverMapper.queryByCarId(carId); |
| | | } |
| | | |
| | | @Override |
| | | public List<BaseWarpper> getServerDriverList(Integer uid, String startLonLat, String endLonLat, Integer type, Integer carModelId) throws Exception { |
| | | Integer companyId = dispatchService.selectById(uid).getCompanyId(); |
| | | List<Driver> drivers = driverMapper.getServerDriverList(companyId, type); |
| | | List<BaseWarpper> list = new ArrayList<>(); |
| | | drivers.forEach(driver -> { |
| | | Car car = carService.selectById(driver.getCarId()); |
| | | if(type == 1){ |
| | | CarService carService = carServiceService.selectOne(new EntityWrapper<CarService>().eq("carId", car.getId()).eq("type", type).eq("serverCarModelId", carModelId)); |
| | | if(null == carService){ |
| | | return; |
| | | } |
| | | } |
| | | BaseWarpper baseWarpper = new BaseWarpper(); |
| | | baseWarpper.setId(driver.getId()); |
| | | baseWarpper.setName(driver.getName() + "-" + car.getCarLicensePlate()); |
| | | list.add(baseWarpper); |
| | | }); |
| | | return list; |
| | | } |
| | | } |