Pu Zhibing
昨天 c3b7673c16d026e57f8759b4cee99a42bf3c57f2
UserZYTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/specialTrain/server/impl/OrderPrivateCarServiceImpl.java
@@ -211,7 +211,7 @@
    public synchronized ResultUtil<BaseWarpper> saveOrderPrivateCar(Integer serverCarModelId, Date travelTime, Integer reservation, Integer instead, String placementLon, String placementLat, String startLon, String startLat,
                                          String startAddress, String endLon, String endLat, String endAddress, String name, String phone, Integer orderSource, Integer driverId, Integer type, Integer uid,
                                                                    BigDecimal estimatedPrice,String cityCode,Integer carIndex) throws Exception {
        long timeMillis = System.currentTimeMillis();
        //如果出行时间大于当前10分钟则默认为预约单
        if(travelTime.getTime() > (System.currentTimeMillis() + 600000)){
            reservation = 2;
@@ -405,18 +405,9 @@
                }
                AssignOrder assignOrder = assignOrderService.selectOne(new EntityWrapper<AssignOrder>().eq("companyId", query.getId()).eq("type", 1));
                if(null != assignOrder){//配置了指派规则才处理
                    boolean lock = redisUtil.lock("order_lock", 10);
                    boolean lock = redisUtil.lock("order_lock", 10, 30);
                    if(!lock){
                        int num1 = 1;
                        while (num1 <= 10){
                            Thread.sleep(3000);//等待3秒
                            lock = redisUtil.lock("order_lock", 10);
                            if(lock){
                                break;
                            }else{
                                num1++;
                            }
                        }
                        return ResultUtil.error("系统繁忙,请稍后重试");
                    }
                    try {
                        //获取空闲司机
@@ -1043,18 +1034,9 @@
     */
    @Override
    public ResultUtil cancleOrderPrivateCar(Integer id, Integer payType, Integer cancleId, Integer type) throws Exception {
        boolean lock = redisUtil.lock(id + "_cancleOrder", 10);
        boolean lock = redisUtil.lock(id + "_cancleOrder", 10, 30);
        if(!lock){
            int num1 = 1;
            while (num1 <= 10){
                Thread.sleep(3000);//等待3秒
                lock = redisUtil.lock(id + "_cancleOrder", 10);
                if(lock){
                    break;
                }else{
                    num1++;
                }
            }
            return ResultUtil.error("系统繁忙,请稍后重试");
        }
        ResultUtil resultUtil = ResultUtil.success("");
        try {
@@ -1393,18 +1375,9 @@
    @Override
    public ResultUtil payPrivateCarOrder(Integer payType, Integer orderId, Integer couponId, Integer type) throws Exception {
        boolean lock = redisUtil.lock(orderId + "_payment", 10);
        boolean lock = redisUtil.lock(orderId + "_payment", 10, 30);
        if(!lock){
            int num1 = 1;
            while (num1 <= 10){
                Thread.sleep(3000);//等待3秒
                lock = redisUtil.lock(orderId + "_payment", 10);
                if(lock){
                    break;
                }else{
                    num1++;
                }
            }
            return ResultUtil.error("系统繁忙,请稍后重试");
        }
        try {
            OrderPrivateCar orderPrivateCar = this.selectById(orderId);
@@ -1911,20 +1884,10 @@
    @Override
    @Transactional(rollbackFor = Exception.class)
    public synchronized void payOrderPrivateCarCallback(Integer id, String order_id, Integer type) throws Exception {
        boolean lock = redisUtil.lock(order_id + "_paymentCallback", 10);
        boolean lock = redisUtil.lock(order_id + "_paymentCallback", 10, 30);
        if(!lock){
            int num1 = 1;
            while (num1 <= 10){
                Thread.sleep(3000);//等待3秒
                lock = redisUtil.lock(order_id + "_paymentCallback", 10);
                if(lock){
                    break;
                }else{
                    num1++;
            return;
                }
            }
        }
        
        try {
            PaymentRecord query = paymentRecordService.query(1, null, null, Integer.valueOf(id), 1, type, null);