| | |
| | | import com.baomidou.mybatisplus.service.impl.ServiceImpl; |
| | | import com.stylefeng.guns.core.util.ToolUtil; |
| | | import com.stylefeng.guns.modular.crossCity.dao.*; |
| | | import com.stylefeng.guns.modular.crossCity.model.*; |
| | | import com.stylefeng.guns.modular.crossCity.model.LineShift; |
| | | import com.stylefeng.guns.modular.crossCity.model.LineShiftDriver; |
| | | import com.stylefeng.guns.modular.crossCity.model.LineSite; |
| | | import com.stylefeng.guns.modular.crossCity.model.OrderCrossCity; |
| | | import com.stylefeng.guns.modular.crossCity.server.ILineSiteService; |
| | | import com.stylefeng.guns.modular.crossCity.server.IOrderCrossCityService; |
| | | import com.stylefeng.guns.modular.crossCity.warpper.SiteWarpper; |
| | |
| | | import com.stylefeng.guns.modular.specialTrain.server.IOrderPrivateCarService; |
| | | import com.stylefeng.guns.modular.system.util.DateUtil; |
| | | import com.stylefeng.guns.modular.system.util.GDMapElectricFenceUtil; |
| | | import com.stylefeng.guns.modular.system.util.RedisUtil; |
| | | import com.stylefeng.guns.modular.system.util.SystemException; |
| | | import com.stylefeng.guns.modular.system.util.model.GeoFencingPolygon; |
| | | import com.stylefeng.guns.modular.taxi.model.OrderTaxi; |
| | | import com.stylefeng.guns.modular.taxi.service.IOrderTaxiService; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.data.mongodb.core.MongoTemplate; |
| | | import org.springframework.data.mongodb.core.geo.GeoJsonPoint; |
| | | import org.springframework.data.mongodb.core.query.Criteria; |
| | | import org.springframework.data.mongodb.core.query.Query; |
| | | import org.springframework.data.redis.core.RedisTemplate; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.text.SimpleDateFormat; |
| | | import java.util.*; |
| | | import java.util.stream.Collectors; |
| | | |
| | | |
| | | @Service |
| | |
| | | |
| | | @Resource |
| | | private LineShiftMapper lineShiftMapper; |
| | | |
| | | |
| | | @Resource |
| | | private LocationMapper locationMapper; |
| | | |
| | | |
| | | @Autowired |
| | | private DateUtil dateUtil; |
| | | |
| | | |
| | | @Autowired |
| | | private GDMapElectricFenceUtil gdMapElectricFenceUtil; |
| | | |
| | | @Autowired |
| | | private RedisUtil redisUtil; |
| | | |
| | | |
| | | @Resource |
| | | private RedisTemplate<String, Object> redisTemplate; |
| | | |
| | | @Autowired |
| | | private IOrderTaxiService orderTaxiService; |
| | | |
| | | |
| | | @Autowired |
| | | private IOrderPrivateCarService orderPrivateCarService; |
| | | |
| | | |
| | | @Autowired |
| | | private IOrderCrossCityService orderCrossCityService; |
| | | |
| | | |
| | | |
| | | |
| | | @Autowired |
| | | private MongoTemplate mongoTemplate; |
| | | |
| | | |
| | | /** |
| | | * 根据线路id获取排班数据 |
| | | * @param lineId |
| | |
| | | List<Map<String, Object>> s = lineSiteMapper.queryDriver(lineId, sdf.parse(day), driverId); |
| | | Calendar calendar = Calendar.getInstance(); |
| | | calendar.setTime(sdf.parse(day)); |
| | | String vehicle = redisUtil.getValue("VEHICLE"); |
| | | String vehicle = (String) redisTemplate.opsForValue().get("VEHICLE"); |
| | | List<Integer> integers = new ArrayList<>(); |
| | | if(ToolUtil.isNotEmpty(vehicle)){ |
| | | integers = JSON.parseArray(vehicle).toJavaList(Integer.class); |
| | |
| | | } |
| | | } |
| | | if(Integer.valueOf(map.get("type").toString()) == 2){//电子围栏 |
| | | String gid = map.get("gid").toString(); |
| | | List<String> list1 = gdMapElectricFenceUtil.monitorElectricFenc("", lonLat); |
| | | if(list1.contains(gid)){ |
| | | String[] split = lonLat.split(","); |
| | | GeoJsonPoint point = new GeoJsonPoint(Double.valueOf(split[0]), Double.valueOf(split[1])); |
| | | Query query = Query.query(Criteria.where("geoJsonPolygon").intersects(point)); |
| | | List<GeoFencingPolygon> geoFencingPolygons = mongoTemplate.find(query, GeoFencingPolygon.class); |
| | | List<Integer> s_sites = geoFencingPolygons.stream().map(GeoFencingPolygon::getSiteId).collect(Collectors.toList()); |
| | | if(s_sites.contains(siteId)){ |
| | | return true; |
| | | } |
| | | continue; |
| | | } |
| | | } |
| | | return false; |