Browse Source

Merge remote-tracking branch 'origin/master_exclusive_shop_20250718' into master_exclusive_shop_20250718

yuhongqi 1 month ago
parent
commit
6a3c877f2a

+ 5 - 5
fs-service-system/src/main/java/com/fs/store/service/impl/FsStoreOrderServiceImpl.java

@@ -501,7 +501,7 @@ public class FsStoreOrderServiceImpl implements IFsStoreOrderService
                 }
                 R process = payment.createOrder(processContext);
                 if("200".equals(String.valueOf(process.get("code")))){
-                    redisCache.setCacheObject("isPaying:"+param.getOrderId(),1);
+                    redisCache.setCacheObject("isPaying:"+param.getOrderId(),1,1,TimeUnit.MINUTES);
 
                     return process;
                 }
@@ -3180,8 +3180,8 @@ public class FsStoreOrderServiceImpl implements IFsStoreOrderService
                 return R.error("此订单没有可支付的金额");
             }
 
-            String orderId=redisCache.getCacheObject("isPaying:"+order.getId());
-            if(StringUtils.isNotEmpty(orderId)&&orderId.equals(order.getId().toString())){
+            Object isPaying=redisCache.getCacheObject("isPaying:"+order.getId());
+            if(ObjectUtil.isNotNull(isPaying)){
                 return R.error("正在支付中...");
             }
 
@@ -3589,8 +3589,8 @@ public class FsStoreOrderServiceImpl implements IFsStoreOrderService
             return R.error("订单状态不正确");
         }
 
-        String orderId=redisCache.getCacheObject("isPaying:"+order.getId());
-        if(StringUtils.isNotEmpty(orderId)&&orderId.equals(order.getId().toString())){
+        Object isPaying =redisCache.getCacheObject("isPaying:"+order.getId());
+        if(ObjectUtil.isNotNull(isPaying)){
             return R.error("正在支付中...");
         }
         List<FsStorePayment>  payments=fsStorePaymentMapper.selectFsStorePaymentByOrder(order.getId());