Pu Zhibing
4 天以前 0cc73a9ffcdd356e0b797e458b400acfb660da94
UserQYTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/taxi/service/impl/OrderTaxiServiceImpl.java
@@ -11,12 +11,14 @@
import com.stylefeng.guns.modular.crossCity.model.OrderCrossCity;
import com.stylefeng.guns.modular.crossCity.server.IOrderCrossCityService;
import com.stylefeng.guns.modular.crossCity.server.impl.OrderCrossCityServiceImpl;
import com.stylefeng.guns.modular.smallLogistics.model.OrderLogistics;
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.specialTrain.server.IOrderPrivateCarService;
import com.stylefeng.guns.modular.system.dao.*;
import com.stylefeng.guns.modular.system.dao.RegionMapper;
import com.stylefeng.guns.modular.system.dao.SensitiveWordsMapper;
import com.stylefeng.guns.modular.system.dao.SysIntegralMapper;
import com.stylefeng.guns.modular.system.dao.UserActivityDiscount1Mapper;
import com.stylefeng.guns.modular.system.model.*;
import com.stylefeng.guns.modular.system.service.*;
import com.stylefeng.guns.modular.system.util.*;
@@ -27,9 +29,9 @@
import com.stylefeng.guns.modular.taxi.service.IOrderTaxiService;
import com.stylefeng.guns.modular.taxi.service.IPaymentRecordService;
import com.stylefeng.guns.modular.taxi.service.ITransactionDetailsService;
import org.bouncycastle.crypto.tls.MACAlgorithm;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.http.HttpEntity;
import org.springframework.http.HttpHeaders;
import org.springframework.http.MediaType;
@@ -117,7 +119,7 @@
    private PushUtil pushUtil;
    @Autowired
    private RedisUtil redisUtil;
    private RedisTemplate redisTemplate;
    @Autowired
    private RestTemplate internalRestTemplate;
@@ -571,7 +573,7 @@
        System.out.println("取消订单:"+query);
        if(null != query){
            if(payType == 1){//微信支付
                String value = redisUtil.getValue("appletOpenId");
                String value = (String) redisTemplate.opsForValue().get("appletOpenId");
                String appletsOpenId = null;
                if(ToolUtil.isNotEmpty(value)){
                    JSONObject jsonObject = JSON.parseObject(value);
@@ -1306,7 +1308,7 @@
            }).start();
            //用户付款后,删除限制司机6分钟不能接单的标识
            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++){
@@ -1315,7 +1317,7 @@
                        break;
                    }
                }
                redisUtil.setStrValue("VEHICLE", jsonArray.toJSONString());
                redisTemplate.opsForValue().set("VEHICLE", jsonArray.toJSONString());
            }
            systemNoticeService.addSystemNotice(1, "您已使用余额成功完成出行订单支付,谢谢使用!", uid, 1);
        }
@@ -1564,7 +1566,7 @@
            }).start();
            //用户付款后,删除限制司机6分钟不能接单的标识
            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++){
@@ -1573,7 +1575,7 @@
                        break;
                    }
                }
                redisUtil.setStrValue("VEHICLE", jsonArray.toJSONString());
                redisTemplate.opsForValue().set("VEHICLE", jsonArray.toJSONString());
            }
            systemNoticeService.addSystemNotice(1, "您已使用余额成功完成出行订单支付,谢谢使用!", uid, 1);
@@ -1710,7 +1712,7 @@
        if(Integer.valueOf(String.valueOf(map.get("state"))) == 11){
            map.put("state", map.get("oldState"));
        }
        String driverId = redisUtil.getValue("DEVICE_" + map.get("driverId"));
        String driverId = (String) redisTemplate.opsForValue().get("DEVICE_" + map.get("driverId"));
        map.put("device", ToolUtil.isNotEmpty(driverId) ? 2 : 1);
        map.put("orderType", 2);
        return map;
@@ -1765,7 +1767,7 @@
            return orderServerWarpper;
        }
        //计算预计距离和剩余时间
        String value = redisUtil.getValue("DRIVER" + String.valueOf(orderTaxi.getDriverId()));
        String value = (String) redisTemplate.opsForValue().get("DRIVER" + String.valueOf(orderTaxi.getDriverId()));
        if(null == value || "".equals(value)){
            System.err.println("司机没有上传位置信息");
@@ -1995,7 +1997,7 @@
            }).start();
            //用户付款后,删除限制司机6分钟不能接单的标识
            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++){
@@ -2004,7 +2006,7 @@
                        break;
                    }
                }
                redisUtil.setStrValue("VEHICLE", jsonArray.toJSONString());
                redisTemplate.opsForValue().set("VEHICLE", jsonArray.toJSONString());
            }
@@ -2081,7 +2083,7 @@
            public void run() {
                try {
                    orderIds.add(orderTaxi.getId());//添加记录,防止调用接口重复提醒无人接单
                    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);