kongdeqiang
2 天以前 199202813dd8ca536ed2334f5eeb6aba3ad25b21
src/main/java/com/boying/controller/phone/YCPayController.java
@@ -64,6 +64,8 @@
    private final OutParkLogService outParkLogService;
    private  final StringRedisTemplate redisTemplate;
    private final PaymentLogService paymentLogService;
    /**
     * 查询订单接口
@@ -77,10 +79,43 @@
            return R.failed("参数为空");
        }
        OutPark byId = outParkService.getById(queryId);
        if(byId.getTime() > 0){
            byId.setTimeStr(DateUtilOther.millisToDayHrMinSec(new Double(byId.getTime()).longValue()));
        PaymentLog byId1 = paymentLogService.getById(queryId);
        if(byId1 !=null && byId !=null){
            if(byId.getCreateTime().isAfter(byId1.getCreateTime())){
                //出场表时间在月票后
                if(byId.getTime() > 0){
                    byId.setTimeStr(DateUtilOther.millisToDayHrMinSec(new Double(byId.getTime()).longValue()));
                }
                return R.ok(byId,"请求成功");
            }else {
                //出场表时间在月票后
                OutPark outPark = new OutPark();
                outPark.setId(byId1.getId());
                outPark.setCreateTime(LocalDateTime.now());
                outPark.setEnterTime(LocalDateTime.now());
                outPark.setTime(0.0);
                outPark.setTimeStr(DateUtilOther.millisToDayHrMinSec(new Double(outPark.getTime()).longValue()));
                outPark.setPrice(byId1.getMoney());
                return R.ok(outPark,"请求成功");
            }
        }
        return R.ok(byId,"请求成功");
        if(byId == null){
            OutPark outPark = new OutPark();
            outPark.setId(byId1.getId());
            outPark.setCreateTime(LocalDateTime.now());
            outPark.setEnterTime(LocalDateTime.now());
            outPark.setTime(0.0);
            outPark.setTimeStr(DateUtilOther.millisToDayHrMinSec(new Double(outPark.getTime()).longValue()));
            outPark.setPrice(byId1.getMoney());
            return R.ok(outPark,"请求成功");
        }
        if(byId1 == null){
            if(byId.getTime() > 0){
                byId.setTimeStr(DateUtilOther.millisToDayHrMinSec(new Double(byId.getTime()).longValue()));
            }
            return R.ok(byId,"请求成功");
        }
        return R.failed("未查询到数据");
    }
    /**