| | |
| | | import java.math.BigDecimal; |
| | | import java.math.RoundingMode; |
| | | import java.util.*; |
| | | import java.util.concurrent.TimeUnit; |
| | | import java.util.stream.Collectors; |
| | | |
| | | /** |
| | | * 首页统计 |
| | |
| | | |
| | | @Autowired |
| | | private ShiroExtUtil shiroExtUtil; |
| | | @Autowired |
| | | private ITOrderPrivateCarService iTOrderPrivateCarService; |
| | | |
| | | @RequestMapping("/openNetCarInfo") |
| | | public Object openNetCarInfo(Integer id, Model model) { |
| | |
| | | } |
| | | int i = tUserService.selectCount(ne); |
| | | map1.put("passengerInfo", i); //新增用户 |
| | | redisTemplate.opsForValue().set("dache:DRIVER14", "123456", 30, TimeUnit.SECONDS); |
| | | |
| | | Wrapper<TDriver> ne1 = new EntityWrapper<TDriver>().ne("state", 1).eq("authState", 2).ne("flag", 3); |
| | | Wrapper<TDriver> warpper = new EntityWrapper<TDriver>().eq("authState", 2).eq("state", 2).ne("flag", 3); |
| | | if (companyId != null) { |
| | | ne1.eq("companyId", companyId).or().eq("franchiseeId", companyId); |
| | | warpper.eq("companyId", companyId); |
| | | } |
| | | int count = tDriverService.selectCount(new EntityWrapper<TDriver>().ne("state", 1).eq("authState", 2).ne("flag", 3)); |
| | | List<TDriver> tDrivers = tDriverService.selectList(warpper); |
| | | int count = 0; |
| | | for (TDriver tDriver : tDrivers) { |
| | | Boolean hasKey = redisTemplate.hasKey("dache:DRIVER" + tDriver.getId()); |
| | | if(hasKey){ |
| | | count++ ; |
| | | } |
| | | } |
| | | map1.put("netcardriver", count); //在线司机 |
| | | |
| | | Wrapper<TOrderTaxi> travelTime1 = new EntityWrapper<TOrderTaxi>().between("insertTime", calendar1.getTime(), calendar2.getTime()); |
| | |
| | | } |
| | | map.put("driver", list); |
| | | |
| | | |
| | | |
| | | Map<String, Object> map2 = new HashMap<>(); |
| | | Wrapper<TOrderTaxi> eq = new EntityWrapper<TOrderTaxi>().eq("state", 1).eq("isDelete", 1); |
| | | Wrapper<TOrderPrivateCar> eq = new EntityWrapper<TOrderPrivateCar>().eq("state", 1).eq("isDelete", 1); |
| | | if(companyId != null){ |
| | | eq.eq("companyId", companyId); |
| | | } |
| | | List<TOrderTaxi> tOrderTaxis = tOrderTaxiService.selectList(eq); |
| | | List<TOrderPrivateCar> tOrderPrivateCars = iTOrderPrivateCarService.selectList(eq); |
| | | list = new ArrayList<>(); |
| | | for(TOrderPrivateCar t : tOrderPrivateCars){ |
| | | Map<String, Object> map1 = new HashMap<>(); |
| | | map1.put("start", t.getStartAddress()); |
| | | map1.put("end", t.getEndAddress()); |
| | | map1.put("travelTime", t.getTravelTime()); |
| | | map1.put("carModel", ""); |
| | | map1.put("num", 1); |
| | | list.add(map1); |
| | | } |
| | | map2.put("zhuanche", list); |
| | | |
| | | Wrapper<TOrderTaxi> eq1 = new EntityWrapper<TOrderTaxi>().eq("state", 1).eq("isDelete", 1); |
| | | if(companyId != null){ |
| | | eq1.eq("companyId", companyId); |
| | | } |
| | | List<TOrderTaxi> tOrderTaxis = tOrderTaxiService.selectList(eq1); |
| | | list = new ArrayList<>(); |
| | | for(TOrderTaxi t : tOrderTaxis){ |
| | | Map<String, Object> map1 = new HashMap<>(); |
| | |
| | | @ResponseBody |
| | | @PostMapping("/getAllOrder") |
| | | public Object getAllOrder(){ |
| | | List<TOrderTaxi> tOrderTaxis = tOrderTaxiService.selectList(new EntityWrapper<TOrderTaxi>().eq("isDelete", 1)); |
| | | List<TOrderPrivateCar> orderPrivateCars = itOrderPrivateCarService.selectList(new EntityWrapper<TOrderPrivateCar>().eq("isDelete", 1).in("state", Arrays.asList(8, 9))); |
| | | List list = new ArrayList<>(); |
| | | for(TOrderPrivateCar t : orderPrivateCars){ |
| | | Map<String, Object> map = new HashMap<>(); |
| | | if(Objects.isNull(t.getStartLon()) || Objects.isNull(t.getStartLat())){ |
| | | continue; |
| | | } |
| | | map.put("lon", t.getStartLon()); |
| | | map.put("lat", t.getStartLat()); |
| | | list.add(map); |
| | | } |
| | | List<TOrderTaxi> tOrderTaxis = tOrderTaxiService.selectList(new EntityWrapper<TOrderTaxi>().eq("isDelete", 1).in("state", Arrays.asList(8, 9))); |
| | | for(TOrderTaxi t : tOrderTaxis){ |
| | | Map<String, Object> map = new HashMap<>(); |
| | | if(Objects.isNull(t.getStartLon()) || Objects.isNull(t.getStartLat())){ |