| | |
| | | package com.stylefeng.guns.modular.system.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.mapper.EntityWrapper; |
| | | import com.baomidou.mybatisplus.plugins.Page; |
| | | import com.baomidou.mybatisplus.service.impl.ServiceImpl; |
| | | import com.stylefeng.guns.core.common.constant.JwtConstants; |
| | | import com.stylefeng.guns.core.shiro.ShiroKit; |
| | | import com.stylefeng.guns.core.shiro.ShiroUser; |
| | | import com.stylefeng.guns.core.util.JwtTokenUtil; |
| | | import com.stylefeng.guns.core.util.ToolUtil; |
| | | import com.stylefeng.guns.modular.crossCity.dao.OrderCrossCityMapper; |
| | | import com.stylefeng.guns.modular.crossCity.model.OrderCrossCity; |
| | | import com.stylefeng.guns.modular.smallLogistics.server.IOrderLogisticsService; |
| | | import com.stylefeng.guns.modular.specialTrain.dao.OrderPrivateCarMapper; |
| | | import com.stylefeng.guns.modular.specialTrain.model.OrderPrivateCar; |
| | | import com.stylefeng.guns.modular.system.dao.*; |
| | | import com.stylefeng.guns.modular.system.model.*; |
| | | import com.stylefeng.guns.modular.system.model.vo.*; |
| | | import com.stylefeng.guns.modular.system.service.*; |
| | | import com.stylefeng.guns.modular.system.util.*; |
| | | import com.stylefeng.guns.modular.system.util.qianyuntong.SMSUtil; |
| | |
| | | import com.stylefeng.guns.modular.system.warpper.BaseWarpper; |
| | | import com.stylefeng.guns.modular.system.warpper.LoginWarpper; |
| | | import com.stylefeng.guns.modular.system.warpper.RegisteredWarpper; |
| | | import com.stylefeng.guns.modular.taxi.dao.OrderTaxiMapper; |
| | | import com.stylefeng.guns.modular.taxi.model.OrderTaxi; |
| | | import com.stylefeng.guns.modular.taxi.service.IOrderTaxiService; |
| | | import io.rong.models.response.TokenResult; |
| | | import org.apache.shiro.authc.SimpleAuthenticationInfo; |
| | |
| | | import javax.servlet.http.HttpServletRequest; |
| | | import java.math.BigDecimal; |
| | | import java.text.SimpleDateFormat; |
| | | import java.time.LocalDateTime; |
| | | import java.util.*; |
| | | import java.util.concurrent.TimeUnit; |
| | | |
| | |
| | | @Resource |
| | | private DriverMapper driverMapper; |
| | | |
| | | @Resource |
| | | private CompanyCityMapper companyCityMapper; |
| | | |
| | | @Resource |
| | | private UserActivityInviteMapper userActivityInviteMapper; |
| | |
| | | private RedisTemplate<String, Object> redisTemplate; |
| | | |
| | | @Autowired |
| | | private ALiSendSms aLiSendSms; |
| | | |
| | | @Autowired |
| | | private ICompanyCityService companyCityService; |
| | | @Autowired |
| | | private IOpenCityService openCityService; |
| | | |
| | | @Autowired |
| | | private GDFalconUtil gdFalconUtil; |
| | |
| | | private CarServiceMapper carServiceMapper; |
| | | |
| | | @Autowired |
| | | private PushUtil pushUtil; |
| | | |
| | | @Autowired |
| | | private IOrderLogisticsService orderLogisticsService; |
| | | |
| | | @Value("${pushMinistryOfTransport}") |
| | |
| | | |
| | | private String salt = "SA;d5#"; |
| | | |
| | | @Resource |
| | | private OrderPrivateCarMapper orderPrivateCarMapper; |
| | | |
| | | @Resource |
| | | private OrderCrossCityMapper orderCrossCityMapper; |
| | | |
| | | @Resource |
| | | private OrderTaxiMapper orderTaxiMapper; |
| | | |
| | | @Autowired |
| | | private GeodesyUtil geodesyUtil; |
| | | |
| | | |
| | | @Override |
| | | public List<Driver> queryIdleDriver(Integer type, Double lon, Double lat, Double distance, Integer companyId) throws Exception { |
| | | List<Driver> drivers = driverMapper.queryIdleDriver(type, companyId); |
| | | List<Driver> list = new ArrayList<>(); |
| | | for(Driver driver : drivers){ |
| | | String value = (String) redisTemplate.opsForValue().get("DRIVER" + String.valueOf(driver.getId())); |
| | | if(null != value){ |
| | | Map<String, Double> distance1 = geodesyUtil.getDistance(lon + "," + lat, value); |
| | | double d = Double.valueOf(distance1.get("WGS84")).doubleValue(); |
| | | if(d < (distance * 1000)){ |
| | | list.add(driver); |
| | | } |
| | | } |
| | | } |
| | | return list; |
| | | } |
| | | |
| | | @Override |
| | | public List<Driver> queryIdleDriver(Integer type, Integer serverCarModelId, Double lon, Double lat, Double distance, Integer companyId) throws Exception { |
| | | List<Driver> drivers = driverMapper.queryIdleDriver_(type, serverCarModelId, companyId); |
| | | List<Driver> list = new ArrayList<>(); |
| | | for(Driver driver : drivers){ |
| | | String value = (String) redisTemplate.opsForValue().get("DRIVER" + String.valueOf(driver.getId())); |
| | | if(null != value){ |
| | | Map<String, Double> distance1 = geodesyUtil.getDistance(lon + "," + lat, value); |
| | | double d = Double.valueOf(distance1.get("WGS84")).doubleValue(); |
| | | if(d < (distance * 1000)){ |
| | | list.add(driver); |
| | | } |
| | | } |
| | | } |
| | | return list; |
| | | } |
| | | |
| | | /** |
| | | * 获取短信验证码 |
| | |
| | | */ |
| | | @Override |
| | | public Map<String, Object> queryPhone(String code) throws Exception { |
| | | Company query = companyCityService.query(code); |
| | | Map<String, Object> map = new HashMap<>(); |
| | | if(null == query){ |
| | | map.put("phone", ""); |
| | | }else{ |
| | | Phone phone = phoneMapper.queryInfo(query.getId(), 2); |
| | | map.put("phone", null != phone ? phone.getPhone() : ""); |
| | | } |
| | | OpenCity openCity = openCityService.openCity1(code); |
| | | Phone phone = phoneMapper.queryInfo(openCity.getId(), 2, 2); |
| | | map.put("phone", null != phone ? phone.getPhone() : ""); |
| | | return map; |
| | | } |
| | | |
| | |
| | | } |
| | | Company company = companyMapper.selectById(driver.getCompanyId()); |
| | | //查询中台员工数据 |
| | | List<QYTUserInfo> userInfoByPhone = UserUtil.getUserInfoByPhone(driver.getPhone(), company.getEnterCode()); |
| | | if (null == userInfoByPhone || userInfoByPhone.size() == 0) { |
| | | return ResultUtil.error("账号未注册"); |
| | | } |
| | | // List<QYTUserInfo> userInfoByPhone = UserUtil.getUserInfoByPhone(driver.getPhone(), company.getEnterCode()); |
| | | // if (null == userInfoByPhone || userInfoByPhone.size() == 0) { |
| | | // return ResultUtil.error("账号未注册"); |
| | | // } |
| | | |
| | | if (ToolUtil.isNotEmpty(driver.getIdCard()) && driver.getAuthState() == 1) { |
| | | return ResultUtil.error("账号正在审核中,请耐心等待"); |
| | |
| | | loginWarpper.setRongYunToken(token1.getToken()); |
| | | |
| | | //创建高德猎鹰的终端数据 |
| | | String tid = gdFalconUtil.createTerminal(phone); |
| | | loginWarpper.setServerId(gdFalconUtil.getServerId()); |
| | | loginWarpper.setTerminalId(tid); |
| | | // String tid = gdFalconUtil.createTerminal(phone); |
| | | // loginWarpper.setServerId(gdFalconUtil.getServerId()); |
| | | // loginWarpper.setTerminalId(tid); |
| | | return ResultUtil.success(loginWarpper); |
| | | } |
| | | |
| | |
| | | * @throws Exception |
| | | */ |
| | | @Override |
| | | public Map<String, Object> queryPhone(Integer uid) throws Exception { |
| | | public Map<String, Object> queryPhone(Integer uid, String code) throws Exception { |
| | | Driver driver = this.selectById(uid); |
| | | Company company = companyMapper.selectById(driver.getFranchiseeId() != null && driver.getFranchiseeId() != 0 ? driver.getFranchiseeId() : ( |
| | | driver.getCompanyId() != null && driver.getCompanyId() != 0 ? driver.getCompanyId() : 1)); |
| | | OpenCity openCity = openCityService.openCity1(code); |
| | | Company company = companyMapper.selectById(driver.getCompanyId()); |
| | | Map<String, Object> map = new HashMap<>(); |
| | | if(company.getType() == 3){//加盟商 |
| | | Phone phone = phoneMapper.queryInfo(company.getId(), 2); |
| | | map.put("branch", ""); |
| | | Phone phone = phoneMapper.queryInfo(openCity.getId(), 2, 2); |
| | | map.put("franchisee", null != phone ? phone.getPhone() : ""); |
| | | company = companyMapper.selectById(company.getSuperiorId()); |
| | | if(null != company){ |
| | | phone = phoneMapper.queryInfo(company.getId(), 2); |
| | | map.put("branch", null != phone ? phone.getPhone() : ""); |
| | | }else{ |
| | | map.put("branch", ""); |
| | | } |
| | | company = companyMapper.selectById(company.getSuperiorId()); |
| | | if(null != company){ |
| | | phone = phoneMapper.queryInfo(company.getId(), 2); |
| | | map.put("platform", null != phone ? phone.getPhone() : ""); |
| | | }else{ |
| | | map.put("platform", ""); |
| | | } |
| | | phone = phoneMapper.queryInfo(openCity.getId(), 2, 1); |
| | | map.put("platform",null != phone ? phone.getPhone() : ""); |
| | | return map; |
| | | } |
| | | if(company.getType() == 2){//分公司 |
| | | map.put("franchisee", ""); |
| | | Phone phone = phoneMapper.queryInfo(company.getId(), 2); |
| | | Phone phone = phoneMapper.queryInfo(openCity.getId(), 2, 2); |
| | | map.put("branch", null != phone ? phone.getPhone() : ""); |
| | | company = companyMapper.selectById(company.getSuperiorId()); |
| | | if(null != company){ |
| | | phone = phoneMapper.queryInfo(company.getId(), 2); |
| | | map.put("platform",null != phone ? phone.getPhone() : ""); |
| | | }else{ |
| | | map.put("platform", ""); |
| | | } |
| | | phone = phoneMapper.queryInfo(openCity.getId(), 2, 1); |
| | | map.put("platform",null != phone ? phone.getPhone() : ""); |
| | | return map; |
| | | } |
| | | if(company.getType() == 1){//平台 |
| | | map.put("franchisee", ""); |
| | | map.put("branch", ""); |
| | | Phone phone = phoneMapper.queryInfo(company.getId(), 2); |
| | | Phone phone = phoneMapper.queryInfo(company.getId(), 2, 1); |
| | | map.put("platform", null != phone ? phone.getPhone() : ""); |
| | | return map; |
| | | } |
| | |
| | | loginWarpper.setAppid(UUIDUtil.getRandomCode()); |
| | | |
| | | //创建高德猎鹰的终端数据 |
| | | String tid = gdFalconUtil.createTerminal(driver.getPhone()); |
| | | loginWarpper.setServerId(gdFalconUtil.getServerId()); |
| | | loginWarpper.setTerminalId(tid); |
| | | // String tid = gdFalconUtil.createTerminal(driver.getPhone()); |
| | | // loginWarpper.setServerId(gdFalconUtil.getServerId()); |
| | | // loginWarpper.setTerminalId(tid); |
| | | return ResultUtil.success(loginWarpper); |
| | | } |
| | | |
| | |
| | | loginWarpper.setAppid(UUIDUtil.getRandomCode()); |
| | | |
| | | //创建高德猎鹰的终端数据 |
| | | String tid = gdFalconUtil.createTerminal(driver.getPhone()); |
| | | loginWarpper.setServerId(gdFalconUtil.getServerId()); |
| | | loginWarpper.setTerminalId(tid); |
| | | // String tid = gdFalconUtil.createTerminal(driver.getPhone()); |
| | | // loginWarpper.setServerId(gdFalconUtil.getServerId()); |
| | | // loginWarpper.setTerminalId(tid); |
| | | return ResultUtil.success(loginWarpper); |
| | | } |
| | | |
| | |
| | | loginWarpper.setAppid(UUIDUtil.getRandomCode()); |
| | | |
| | | //创建高德猎鹰的终端数据 |
| | | String tid = gdFalconUtil.createTerminal(driver.getPhone()); |
| | | loginWarpper.setServerId(gdFalconUtil.getServerId()); |
| | | loginWarpper.setTerminalId(tid); |
| | | // String tid = gdFalconUtil.createTerminal(driver.getPhone()); |
| | | // loginWarpper.setServerId(gdFalconUtil.getServerId()); |
| | | // loginWarpper.setTerminalId(tid); |
| | | return ResultUtil.success(loginWarpper); |
| | | } |
| | | |
| | |
| | | redisTemplate.delete("DEVICE_" + id);//清除车载端登录的标识 |
| | | return ResultUtil.success(); |
| | | } |
| | | |
| | | |
| | | @Override |
| | | public DriverIndexVo queryHomeDataFromDriver(Integer uid) { |
| | | DriverIndexVo driverIndexVo = new DriverIndexVo(); |
| | | // 获取快车订单 |
| | | List<OrderPrivateCar> orderPrivateCars = orderPrivateCarMapper.selectList(new EntityWrapper<OrderPrivateCar>().ne("state", 10).eq("driverId", uid).like("insertTime", LocalDateTime.now().toString())); |
| | | // 跨城订单 |
| | | List<OrderCrossCity> orderCrossCities = orderCrossCityMapper.selectList(new EntityWrapper<OrderCrossCity>().ne("state", 10).eq("driverId", uid).like("insertTime", LocalDateTime.now().toString())); |
| | | // 出租车订单 |
| | | List<OrderTaxi> orderTaxis = orderTaxiMapper.selectList(new EntityWrapper<OrderTaxi>().ne("state", 10).eq("driverId", uid).like("insertTime", LocalDateTime.now().toString())); |
| | | driverIndexVo.setTodayOrderNum(orderPrivateCars.size() + orderCrossCities.size() + orderTaxis.size()); |
| | | |
| | | |
| | | double sum = orderPrivateCars.stream().mapToDouble(OrderPrivateCar::getOrderMoney).sum(); |
| | | double sum1 = orderCrossCities.stream().mapToDouble(OrderCrossCity::getOrderMoney).sum(); |
| | | double sum2 = orderTaxis.stream().mapToDouble(OrderTaxi::getOrderMoney).sum(); |
| | | driverIndexVo.setTodayOrderMoney(new BigDecimal(sum +sum1+sum2)); |
| | | |
| | | |
| | | BigDecimal reduce = orderPrivateCarMapper.selectList(new EntityWrapper<OrderPrivateCar>().eq("promotionDriverId", uid).like("insertTime", LocalDateTime.now().toString())).stream().map(OrderPrivateCar::getPromotionMoney).reduce(BigDecimal.ZERO, BigDecimal::add); |
| | | BigDecimal reduce1 = orderCrossCityMapper.selectList(new EntityWrapper<OrderCrossCity>().eq("promotionDriverId", uid).like("insertTime", LocalDateTime.now().toString())).stream().map(OrderCrossCity::getPromotionMoney).reduce(BigDecimal.ZERO, BigDecimal::add); |
| | | BigDecimal reduce2 = orderTaxiMapper.selectList(new EntityWrapper<OrderTaxi>().eq("promotionDriverId", uid).like("insertTime", LocalDateTime.now().toString())).stream().map(OrderTaxi::getPromotionMoney).reduce(BigDecimal.ZERO, BigDecimal::add); |
| | | driverIndexVo.setTodayPromotionMoney(reduce.add(reduce1).add(reduce2)); |
| | | return driverIndexVo; |
| | | }; |
| | | |
| | | |
| | | |
| | | @Override |
| | | public DriverOrderDataVo queryOrderDataFromDriver(String time, Page<DriverOrderDataNextVo> driverOrderDataVoPage, Integer uid) { |
| | | SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd"); |
| | | SimpleDateFormat simpleDateFormat1 = new SimpleDateFormat("yyyy-MM"); |
| | | // 总的订单数 |
| | | List<OrderPrivateCar> orderPrivateCars = orderPrivateCarMapper.selectList(new EntityWrapper<OrderPrivateCar>().ne("state", 10).eq("driverId", uid)); |
| | | // 跨城订单 |
| | | List<OrderCrossCity> orderCrossCities = orderCrossCityMapper.selectList(new EntityWrapper<OrderCrossCity>().ne("state", 10).eq("driverId", uid)); |
| | | // 出租车订单 |
| | | List<OrderTaxi> orderTaxis = orderTaxiMapper.selectList(new EntityWrapper<OrderTaxi>().ne("state", 10).eq("driverId", uid)); |
| | | DriverOrderDataVo driverOrderDataVo = new DriverOrderDataVo(); |
| | | driverOrderDataVo.setAllOrderNum(orderPrivateCars.size() + orderCrossCities.size() + orderTaxis.size()); |
| | | long count = orderPrivateCars.stream().filter(e -> simpleDateFormat.format(e.getInsertTime()).equals(LocalDateTime.now().toString())).count(); |
| | | long count1 = orderCrossCities.stream().filter(e -> simpleDateFormat.format(e.getInsertTime()).equals(LocalDateTime.now().toString())).count(); |
| | | long count2 = orderTaxis.stream().filter(e -> simpleDateFormat.format(e.getInsertTime()).equals(LocalDateTime.now().toString())).count(); |
| | | driverOrderDataVo.setTodayOrderNum((int) (count+count1+count2)); |
| | | |
| | | Date date = new Date(); |
| | | String month = simpleDateFormat1.format(date); |
| | | long count3 = orderPrivateCars.stream().filter(e -> simpleDateFormat1.format(e.getInsertTime()).equals(month)).count(); |
| | | long count4 = orderCrossCities.stream().filter(e -> simpleDateFormat1.format(e.getInsertTime()).equals(month)).count(); |
| | | long count5 = orderTaxis.stream().filter(e -> simpleDateFormat1.format(e.getInsertTime()).equals(month)).count(); |
| | | driverOrderDataVo.setMonthOrderNum((int) (count3+count4+count5)); |
| | | |
| | | String sTime=null; |
| | | String eTime=null; |
| | | if(ToolUtil.isNotEmpty( time)){ |
| | | sTime=time.split(" - ")[0]+" 00:00:00"; |
| | | eTime=time.split(" - ")[1]+" 23:59:59"; |
| | | } |
| | | List<DriverOrderDataNextVo> driverOrderDataNextVoPage = driverServiceMapper.queryOrderDataFromDriver(sTime, eTime, driverOrderDataVoPage, uid); |
| | | driverOrderDataVoPage.setRecords(driverOrderDataNextVoPage); |
| | | driverOrderDataVo.setDriverOrderDataNextVos(driverOrderDataVoPage); |
| | | return driverOrderDataVo; |
| | | } |
| | | |
| | | |
| | | |
| | | @Override |
| | | public DriverOrderMoneyDataVo queryOrderMoneyFromDriver(String time, Page<DriverOrderDataNextVo> driverOrderDataVoPage, Integer uid) { |
| | | DriverOrderMoneyDataVo driverOrderDataVo = new DriverOrderMoneyDataVo(); |
| | | SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd"); |
| | | SimpleDateFormat simpleDateFormat1 = new SimpleDateFormat("yyyy-MM"); |
| | | // 总的订单数 |
| | | List<OrderPrivateCar> orderPrivateCars = orderPrivateCarMapper.selectList(new EntityWrapper<OrderPrivateCar>().in("state",Arrays.asList(8,9)).eq("driverId", uid)); |
| | | // 跨城订单 |
| | | List<OrderCrossCity> orderCrossCities = orderCrossCityMapper.selectList(new EntityWrapper<OrderCrossCity>().in("state",Arrays.asList(8,9)).eq("driverId", uid)); |
| | | // 出租车订单 |
| | | List<OrderTaxi> orderTaxis = orderTaxiMapper.selectList(new EntityWrapper<OrderTaxi>().in("state",Arrays.asList(8,9)).eq("driverId", uid)); |
| | | |
| | | |
| | | double sum = orderPrivateCars.stream().mapToDouble(OrderPrivateCar::getOrderMoney).sum(); |
| | | double sum1 = orderCrossCities.stream().mapToDouble(OrderCrossCity::getOrderMoney).sum(); |
| | | double sum2 = orderTaxis.stream().mapToDouble(OrderTaxi::getOrderMoney).sum(); |
| | | driverOrderDataVo.setAllOrderMoney(new BigDecimal(sum +sum1+sum2)); |
| | | |
| | | |
| | | |
| | | double count = orderPrivateCars.stream().filter(e -> simpleDateFormat.format(e.getInsertTime()).equals(LocalDateTime.now().toString())).mapToDouble(OrderPrivateCar::getOrderMoney).sum(); |
| | | double count1 = orderCrossCities.stream().filter(e -> simpleDateFormat.format(e.getInsertTime()).equals(LocalDateTime.now().toString())).mapToDouble(OrderCrossCity::getOrderMoney).sum(); |
| | | double count2 = orderTaxis.stream().filter(e -> simpleDateFormat.format(e.getInsertTime()).equals(LocalDateTime.now().toString())).mapToDouble(OrderTaxi::getOrderMoney).sum(); |
| | | driverOrderDataVo.setTodayOrderMoney(new BigDecimal(count+count1+count2)); |
| | | |
| | | |
| | | Date date = new Date(); |
| | | String month = simpleDateFormat1.format(date); |
| | | double count3 = orderPrivateCars.stream().filter(e -> simpleDateFormat1.format(e.getInsertTime()).equals(month)).mapToDouble(OrderPrivateCar::getOrderMoney).sum(); |
| | | double count4 = orderCrossCities.stream().filter(e -> simpleDateFormat1.format(e.getInsertTime()).equals(month)).mapToDouble(OrderCrossCity::getOrderMoney).sum(); |
| | | double count5 = orderTaxis.stream().filter(e -> simpleDateFormat1.format(e.getInsertTime()).equals(month)).mapToDouble(OrderTaxi::getOrderMoney).sum(); |
| | | driverOrderDataVo.setMonthOrderMoney(new BigDecimal(count3+count4+count5)); |
| | | |
| | | String sTime=null; |
| | | String eTime=null; |
| | | if(ToolUtil.isNotEmpty( time)){ |
| | | sTime=time.split(" - ")[0]+" 00:00:00"; |
| | | eTime=time.split(" - ")[1]+" 23:59:59"; |
| | | } |
| | | List<DriverOrderDataNextVo> driverOrderDataNextVoPage = driverServiceMapper.queryOrderMoneyDataFromDriver(sTime, eTime, driverOrderDataVoPage, uid); |
| | | List<DriverOrderDataNextVo> driverOrderDataNextVoPage1 = driverServiceMapper.queryOrderMoneyDataFromDriverAll(sTime, eTime, uid); |
| | | double sum3 = driverOrderDataNextVoPage1.stream().mapToDouble(DriverOrderDataNextVo::getOrderMoney).sum(); |
| | | driverOrderDataVo.setSearchMoney(new BigDecimal(sum3)); |
| | | driverOrderDataVoPage.setRecords(driverOrderDataNextVoPage); |
| | | driverOrderDataVo.setDriverOrderDataNextVos(driverOrderDataVoPage); |
| | | return driverOrderDataVo; |
| | | } |
| | | @Override |
| | | public DriverOrderPromotionDataVo queryOrderPromotionFromDriver(String time, Page<DriverOrderDataNextVo> driverOrderDataVoPage, Integer uid) { |
| | | DriverOrderPromotionDataVo driverOrderDataVo = new DriverOrderPromotionDataVo(); |
| | | SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd"); |
| | | SimpleDateFormat simpleDateFormat1 = new SimpleDateFormat("yyyy-MM"); |
| | | // 总的订单数 |
| | | List<OrderPrivateCar> orderPrivateCars = orderPrivateCarMapper.selectList(new EntityWrapper<OrderPrivateCar>().in("state",Arrays.asList(8,9)).eq("promotionDriverId", uid)); |
| | | // 跨城订单 |
| | | List<OrderCrossCity> orderCrossCities = orderCrossCityMapper.selectList(new EntityWrapper<OrderCrossCity>().in("state",Arrays.asList(8,9)).eq("promotionDriverId", uid)); |
| | | // 出租车订单 |
| | | List<OrderTaxi> orderTaxis = orderTaxiMapper.selectList(new EntityWrapper<OrderTaxi>().in("state",Arrays.asList(8,9)).eq("promotionDriverId", uid)); |
| | | |
| | | |
| | | BigDecimal sum = orderPrivateCars.stream().map(OrderPrivateCar::getPromotionMoney).reduce(BigDecimal.ZERO, BigDecimal::add); |
| | | BigDecimal sum1 = orderCrossCities.stream().map(OrderCrossCity::getPromotionMoney).reduce(BigDecimal.ZERO, BigDecimal::add); |
| | | BigDecimal sum2 = orderTaxis.stream().map(OrderTaxi::getPromotionMoney).reduce(BigDecimal.ZERO, BigDecimal::add); |
| | | driverOrderDataVo.setAllOrderMoney(sum.add(sum1).add(sum2)); |
| | | |
| | | |
| | | |
| | | BigDecimal count = orderPrivateCars.stream().filter(e -> simpleDateFormat.format(e.getInsertTime()).equals(LocalDateTime.now().toString())).map(OrderPrivateCar::getPromotionMoney).reduce(BigDecimal.ZERO, BigDecimal::add); |
| | | BigDecimal count1 = orderCrossCities.stream().filter(e -> simpleDateFormat.format(e.getInsertTime()).equals(LocalDateTime.now().toString())).map(OrderCrossCity::getPromotionMoney).reduce(BigDecimal.ZERO, BigDecimal::add); |
| | | BigDecimal count2 = orderTaxis.stream().filter(e -> simpleDateFormat.format(e.getInsertTime()).equals(LocalDateTime.now().toString())).map(OrderTaxi::getPromotionMoney).reduce(BigDecimal.ZERO, BigDecimal::add); |
| | | driverOrderDataVo.setTodayOrderMoney(count.add(count1).add(count2)); |
| | | |
| | | |
| | | Date date = new Date(); |
| | | String month = simpleDateFormat1.format(date); |
| | | BigDecimal count3 = orderPrivateCars.stream().filter(e -> simpleDateFormat1.format(e.getInsertTime()).equals(month)).map(OrderPrivateCar::getPromotionMoney).reduce(BigDecimal.ZERO, BigDecimal::add); |
| | | BigDecimal count4 = orderCrossCities.stream().filter(e -> simpleDateFormat1.format(e.getInsertTime()).equals(month)).map(OrderCrossCity::getPromotionMoney).reduce(BigDecimal.ZERO, BigDecimal::add); |
| | | BigDecimal count5 = orderTaxis.stream().filter(e -> simpleDateFormat1.format(e.getInsertTime()).equals(month)).map(OrderTaxi::getPromotionMoney).reduce(BigDecimal.ZERO, BigDecimal::add); |
| | | driverOrderDataVo.setMonthOrderMoney(count3.add(count4).add(count5)); |
| | | |
| | | String sTime=null; |
| | | String eTime=null; |
| | | if(ToolUtil.isNotEmpty( time)){ |
| | | sTime=time.split(" - ")[0]+" 00:00:00"; |
| | | eTime=time.split(" - ")[1]+" 23:59:59"; |
| | | } |
| | | List<DriverOrderDataNextVo> driverOrderDataNextVoPage = driverServiceMapper.queryOrderPromotionFromDriver(sTime, eTime, driverOrderDataVoPage, uid); |
| | | List<DriverOrderDataNextVo> driverOrderDataNextVoPage1 =driverServiceMapper.queryOrderPromotionFromDriverAll(sTime, eTime, uid); |
| | | double sum3 = driverOrderDataNextVoPage1.stream().mapToDouble(DriverOrderDataNextVo::getOrderMoney).sum(); |
| | | driverOrderDataVo.setSearchMoney(new BigDecimal(sum3)); |
| | | |
| | | driverOrderDataVoPage.setRecords(driverOrderDataNextVoPage); |
| | | driverOrderDataVo.setDriverOrderDataNextVos(driverOrderDataVoPage); |
| | | return driverOrderDataVo; |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 单点登录 |
| | | * |