From 199202813dd8ca536ed2334f5eeb6aba3ad25b21 Mon Sep 17 00:00:00 2001
From: kongdeqiang <123456>
Date: 星期一, 22 十二月 2025 08:49:51 +0800
Subject: [PATCH] fix : 新分支

---
 src/main/java/com/boying/controller/phone/YCPayController.java |   41 ++++++++++++++++++++++++++++++++++++++---
 1 files changed, 38 insertions(+), 3 deletions(-)

diff --git a/src/main/java/com/boying/controller/phone/YCPayController.java b/src/main/java/com/boying/controller/phone/YCPayController.java
index 9f54dde..eb20fea 100644
--- a/src/main/java/com/boying/controller/phone/YCPayController.java
+++ b/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("鏈煡璇㈠埌鏁版嵁");
     }
 
     /**

--
Gitblit v1.9.1