| | |
| | | import com.stylefeng.guns.core.util.ToolUtil; |
| | | import com.stylefeng.guns.modular.specialTrain.model.OrderPrivateCar; |
| | | import com.stylefeng.guns.modular.specialTrain.server.IOrderPrivateCarService; |
| | | import com.stylefeng.guns.modular.system.dao.RegionMapper; |
| | | import com.stylefeng.guns.modular.system.model.*; |
| | | import com.stylefeng.guns.modular.system.model.Company; |
| | | import com.stylefeng.guns.modular.system.model.Driver; |
| | | import com.stylefeng.guns.modular.system.model.OrderAdditionalFee; |
| | | import com.stylefeng.guns.modular.system.model.OrderPosition; |
| | | import com.stylefeng.guns.modular.system.service.*; |
| | | import com.stylefeng.guns.modular.system.util.*; |
| | | 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.swagger.annotations.ApiImplicitParam; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.data.redis.core.RedisTemplate; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Isolation; |
| | | import org.springframework.transaction.annotation.Propagation; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.math.BigDecimal; |
| | |
| | | |
| | | @Autowired |
| | | private GDFalconUtil gdFalconUtil; |
| | | |
| | | |
| | | @Autowired |
| | | private RedisUtil redisUtil; |
| | | private RedisTemplate redisTemplate; |
| | | |
| | | @Autowired |
| | | private IOrderPositionService orderPositionService; |
| | |
| | | orderTaxi.setArriveTime(date); |
| | | orderTaxi.setStartServiceTime(date); |
| | | orderTaxi.setBoardingTime(date); |
| | | |
| | | String value = redisUtil.getValue("DRIVER" + uid); |
| | | if(ToolUtil.isNotEmpty(value)){ |
| | | |
| | | String value = (String) redisTemplate.opsForValue().get("DRIVER" + uid); |
| | | if (ToolUtil.isNotEmpty(value)) { |
| | | String[] split = value.split(","); |
| | | Map<String, String> geocode1 = gdMapGeocodingUtil.geocode(split[0], split[1]); |
| | | orderTaxi.setBoardingAddress(geocode1.get("address")); |
| | | orderTaxi.setBoardingLon(Double.valueOf(split[0])); |
| | | orderTaxi.setBoardingLat(Double.valueOf(split[1])); |
| | | } |
| | | |
| | | |
| | | //调用高德创建轨迹 |
| | | String s = gdFalconUtil.selectTerminal(driver.getPhone()); |
| | | String track = gdFalconUtil.createTrack(s); |
| | |
| | | } |
| | | }).start(); |
| | | //添加定时任务6分钟司机不确认收款自动完成支付(仅车载端),6分钟之内司机无法接单 |
| | | String vehicle = redisUtil.getValue("VEHICLE"); |
| | | String vehicle = (String) redisTemplate.opsForValue().get("VEHICLE"); |
| | | JSONArray jsonArray = new JSONArray(); |
| | | if(ToolUtil.isNotEmpty(vehicle)){ |
| | | jsonArray = JSON.parseArray(vehicle); |
| | | } |
| | | jsonArray.add(orderTaxi.getDriverId()); |
| | | redisUtil.setStrValue("VEHICLE", jsonArray.toJSONString());//添加司机不能接单标识 |
| | | redisTemplate.opsForValue().set("VEHICLE", jsonArray.toJSONString());//添加司机不能接单标识 |
| | | |
| | | TimerTask timerTask = new TimerTask() { |
| | | @Override |
| | |
| | | orderTaxi1.setPayMoney(orderTaxi1.getOrderMoney()); |
| | | orderTaxi1.setState(8); |
| | | OrderTaxiServiceImpl.this.updateById(orderTaxi1); |
| | | |
| | | String vehicle = redisUtil.getValue("VEHICLE"); |
| | | |
| | | String vehicle = (String) redisTemplate.opsForValue().get("VEHICLE"); |
| | | if(ToolUtil.isNotEmpty(vehicle)){ |
| | | JSONArray jsonArray = JSON.parseArray(vehicle); |
| | | for(int i = 0; i < jsonArray.size(); i++){ |
| | |
| | | break; |
| | | } |
| | | } |
| | | redisUtil.setStrValue("VEHICLE", jsonArray.toJSONString()); |
| | | redisTemplate.opsForValue().set("VEHICLE", jsonArray.toJSONString()); |
| | | } |
| | | |
| | | new Thread(new Runnable() { |
| | |
| | | }).start(); |
| | | |
| | | //添加定时任务6分钟司机不确认收款自动完成支付(仅车载端),6分钟之内司机无法接单 |
| | | String vehicle = redisUtil.getValue("VEHICLE"); |
| | | String vehicle = (String) redisTemplate.opsForValue().get("VEHICLE"); |
| | | JSONArray jsonArray = new JSONArray(); |
| | | if(ToolUtil.isNotEmpty(vehicle)){ |
| | | jsonArray = JSON.parseArray(vehicle); |
| | | } |
| | | jsonArray.add(orderTaxi.getDriverId()); |
| | | redisUtil.setStrValue("VEHICLE", jsonArray.toJSONString());//添加司机不能接单标识 |
| | | redisTemplate.opsForValue().set("VEHICLE", jsonArray.toJSONString());//添加司机不能接单标识 |
| | | |
| | | TimerTask timerTask = new TimerTask() { |
| | | @Override |
| | |
| | | orderTaxi1.setPayMoney(orderTaxi1.getOrderMoney()); |
| | | orderTaxi1.setState(8); |
| | | OrderTaxiServiceImpl.this.updateById(orderTaxi1); |
| | | |
| | | String vehicle = redisUtil.getValue("VEHICLE"); |
| | | |
| | | String vehicle = (String) redisTemplate.opsForValue().get("VEHICLE"); |
| | | if(ToolUtil.isNotEmpty(vehicle)){ |
| | | JSONArray jsonArray = JSON.parseArray(vehicle); |
| | | for(int i = 0; i < jsonArray.size(); i++){ |
| | |
| | | break; |
| | | } |
| | | } |
| | | redisUtil.setStrValue("VEHICLE", jsonArray.toJSONString()); |
| | | redisTemplate.opsForValue().set("VEHICLE", jsonArray.toJSONString()); |
| | | } |
| | | |
| | | new Thread(new Runnable() { |